/* ===== CRM FRONTEND STYLES ===== */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700&family=Poppins:wght@300;400;500;600&display=swap');

:root {
  --crm-orange: #F97316;
  --crm-orange-dark: #ea580c;
  --crm-dark: #111827;
  --crm-green: #16a34a;
  --crm-red: #dc2626;
  --crm-blue: #1e40af;
  --crm-border: #e2e2e2;
  --crm-bg: #fafafa;
  --crm-radius: 12px;
  --crm-font: 'Poppins', sans-serif;
}

/* ===== BOOKING FORM ===== */
.crm-booking-card {
  background: white;
  border-radius: 20px;
  padding: 32px 36px 28px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.12);
  font-family: var(--crm-font);
}

.crm-row-1 {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 16px;
  align-items: end;
  margin-bottom: 22px;
}

.crm-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.crm-field-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.crm-field-group label {
  font-size: 0.76rem;
  font-weight: 600;
  color: #222;
}

.crm-input-wrap {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--crm-border);
  border-radius: var(--crm-radius);
  background: var(--crm-bg);
  height: 50px;
  overflow: hidden;
  transition: border-color .2s, box-shadow .2s;
}

.crm-input-wrap:focus-within {
  border-color: var(--crm-orange);
  background: white;
  box-shadow: 0 0 0 3px rgba(249,115,22,0.1);
}

.crm-field-group.has-error .crm-input-wrap {
  border-color: var(--crm-red);
  box-shadow: 0 0 0 3px rgba(220,38,38,0.08);
}

.crm-icon {
  display: flex;
  align-items: center;
  padding: 0 10px 0 14px;
  flex-shrink: 0;
  color: var(--crm-orange);
}

.crm-chevron {
  display: flex;
  align-items: center;
  padding: 0 12px;
  flex-shrink: 0;
  color: #bbb;
  pointer-events: none;
}

.crm-input-wrap select,
.crm-input-wrap input[type="date"],
.crm-input-wrap input[type="time"] {
  flex: 1;
  border: none;
  background: transparent;
  font-family: var(--crm-font);
  font-size: 0.83rem;
  color: #333;
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  padding: 0;
  min-width: 0;
}

.crm-datetime-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.crm-error {
  font-size: 0.71rem;
  color: var(--crm-red);
  display: none;
  margin-top: 2px;
}

.crm-field-group.has-error .crm-error { display: block; }

.crm-btn-search {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--crm-orange), var(--crm-orange-dark));
  color: white;
  border: none;
  border-radius: var(--crm-radius);
  padding: 0 28px;
  height: 50px;
  font-family: var(--crm-font);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(249,115,22,0.35);
  transition: all .2s;
}

.crm-btn-search:hover {
  background: linear-gradient(135deg, var(--crm-orange-dark), #c2410c);
  transform: translateY(-1px);
}

/* ===== OVERLAY & MODAL ===== */
.crm-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 20px;
  font-family: var(--crm-font);
}

.crm-overlay.show { display: flex; }

.crm-modal {
  background: white;
  border-radius: 18px;
  padding: 32px;
  max-width: 520px;
  width: 100%;
  box-shadow: 0 30px 80px rgba(0,0,0,0.2);
  animation: crmPop .25s ease;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

@keyframes crmPop {
  from { opacity: 0; transform: scale(.95) translateY(16px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.crm-modal-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1rem;
  font-weight: 600;
  color: #111;
  margin-bottom: 20px;
}

.crm-modal-title svg { stroke: var(--crm-green); }

.crm-modal-row {
  display: flex;
  justify-content: space-between;
  padding: 11px 0;
  border-bottom: 1px solid #f3f3f3;
  font-size: 0.82rem;
}

.crm-modal-row:last-of-type { border-bottom: none; }
.crm-modal-row span:first-child { color: #888; }
.crm-modal-row span:last-child { font-weight: 600; color: #111; }

.crm-modal-vehicles-wrap {
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid #eee;
}

.crm-modal-vehicles-wrap[hidden] { display: none !important; }

.crm-modal-vehicles-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}

.crm-modal-loading {
  text-align: center;
  color: #888;
  padding: 14px;
  font-size: 0.85rem;
}

.crm-modal-no-vehicles {
  font-size: 0.85rem;
  color: #888;
  padding: 8px 0;
}

.crm-modal-veh-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #f3f3f3;
}

.crm-modal-veh-row:last-child { border-bottom: none; }

.crm-modal-veh-thumb {
  width: 68px;
  height: 52px;
  border-radius: 8px;
  object-fit: cover;
  background: #f5f5f5;
  flex-shrink: 0;
}

.crm-modal-veh-thumb.crm-modal-veh-thumb--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ccc;
}

.crm-modal-veh-info {
  flex: 1;
  min-width: 0;
}

.crm-modal-veh-name {
  font-weight: 600;
  font-size: 0.86rem;
  color: #111;
  line-height: 1.25;
  margin-bottom: 4px;
}

.crm-modal-veh-meta {
  font-size: 0.75rem;
  color: #666;
}

.crm-btn-reserve.crm-btn-reserve--modal {
  width: auto;
  padding: 9px 14px;
  font-size: 0.76rem;
  flex-shrink: 0;
}

.crm-modal-more {
  font-size: 0.8rem;
  color: #888;
  text-align: center;
  margin-top: 10px;
}

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

.crm-modal-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 22px; }

.crm-btn-voir {
  background: linear-gradient(135deg, var(--crm-orange), var(--crm-orange-dark));
  color: white; border: none; border-radius: 10px;
  padding: 14px; font-family: var(--crm-font);
  font-size: 0.9rem; font-weight: 600; cursor: pointer;
  transition: all .2s; width: 100%;
}

.crm-btn-voir:hover { background: linear-gradient(135deg, var(--crm-orange-dark), #c2410c); }

.crm-btn-modifier {
  background: #f5f5f5; color: #444; border: none;
  border-radius: 10px; padding: 13px; width: 100%;
  font-family: var(--crm-font); font-size: 0.88rem;
  font-weight: 500; cursor: pointer;
}

.crm-btn-modifier:hover { background: #ebebeb; }

/* ===== VEHICLE LISTING ===== */
.crm-listing-wrap { font-family: var(--crm-font); }

.crm-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 30px;
}

.crm-tab {
  background: white;
  border: 1.5px solid var(--crm-border);
  border-radius: 50px;
  padding: 8px 18px;
  font-family: var(--crm-font);
  font-size: 0.83rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all .2s;
  color: #444;
}

.crm-tab span {
  background: #f0f0f0;
  border-radius: 50px;
  padding: 1px 8px;
  font-size: 0.75rem;
}

.crm-tab.active {
  background: var(--crm-orange);
  border-color: var(--crm-orange);
  color: white;
}

.crm-tab.active span { background: rgba(255,255,255,0.3); }

.crm-tab:hover:not(.active) {
  border-color: var(--crm-orange);
  color: var(--crm-orange);
}

.crm-vehicle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.crm-vehicle-card {
  background: linear-gradient(180deg,#ffffff 54%, #111827 54%);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 6px 28px rgba(0,0,0,0.12);
  transition: transform .18s, box-shadow .18s, border-color .12s;
  border: 2px solid transparent;
}

.crm-vehicle-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 48px rgba(0,0,0,0.18);
  border-color: #ef4444; /* subtle red outline on hover like screenshot */
}

.crm-card-image {
  position: relative;
  background: #f8f8f8;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.crm-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.crm-no-image {
  color: #ccc;
}

.crm-cat-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(0,0,0,0.6);
  color: white;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  letter-spacing: 1px;
}

.crm-card-body { padding: 18px; background: #111827; color: #e6eef6; }

.crm-card-body h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
  margin-bottom: 10px;
  color: #d1d5db;
}

.crm-vehicle-link {
  color: inherit;
  text-decoration: none;
}

.crm-vehicle-link:hover {
  color: var(--crm-orange);
}

.crm-card-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.crm-card-specs span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: #9ca3af;
  background: rgba(255,255,255,0.06);
  padding: 8px 10px;
  border-radius: 8px;
}

.crm-card-specs svg { color: #888; }

.crm-card-price {
  font-size: 1.3rem;
  font-weight: 700;
  color: #10b981;
  margin: 12px 0 16px;
}

.crm-card-price span {
  font-size: 0.85rem;
  font-weight: 400;
  color: #888;
}

.crm-btn-reserve-link,
.crm-btn-reserve {
  display: inline-block;
  width: 100%;
  text-align: center;
  background: linear-gradient(135deg,#0ea5e9,#3b82f6);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 12px 14px;
  font-family: var(--crm-font);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(59,130,246,0.18);
  transition: transform .14s, box-shadow .14s, opacity .14s;
}

.crm-btn-reserve-link:hover,
.crm-btn-reserve:hover { transform: translateY(-2px); opacity: 0.98; }

/* ===== BOOKING MODAL ===== */
.crm-booking-modal { max-width: 540px; }

.crm-modal-close {
  position: absolute;
  top: 16px; right: 16px;
  background: #f0f0f0;
  border: none;
  border-radius: 50%;
  width: 32px; height: 32px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.crm-booking-modal h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  margin-bottom: 6px;
}

.crm-booking-price-info {
  font-size: 0.82rem;
  color: #888;
  margin-bottom: 18px;
}

.crm-booking-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}

.crm-form-field { display: flex; flex-direction: column; gap: 5px; }
.crm-form-field label { font-size: 0.75rem; font-weight: 600; color: #444; }
.crm-form-field input,
.crm-form-field textarea {
  border: 1.5px solid var(--crm-border);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: var(--crm-font);
  font-size: 0.83rem;
  outline: none;
  transition: border-color .2s;
}
.crm-form-field input:focus,
.crm-form-field textarea:focus { border-color: var(--crm-orange); }

.crm-full-width { grid-column: 1 / -1; }

.crm-booking-summary {
  background: #fef9f3;
  border: 1px solid #fed7aa;
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 0.82rem;
  color: #444;
  margin-bottom: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.crm-booking-summary .crm-sum-total {
  grid-column: 1/-1;
  font-size: 1rem;
  font-weight: 700;
  color: var(--crm-orange);
  border-top: 1px solid #fed7aa;
  padding-top: 10px;
  margin-top: 6px;
}

.crm-btn-confirm {
  width: 100%;
  background: linear-gradient(135deg, var(--crm-orange), var(--crm-orange-dark));
  color: white; border: none; border-radius: 10px;
  padding: 14px; font-family: var(--crm-font);
  font-size: 0.92rem; font-weight: 600; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: all .2s;
}

.crm-btn-confirm:hover { background: linear-gradient(135deg, var(--crm-orange-dark), #c2410c); }

/* Success modal */
.crm-success-modal { text-align: center; }
.crm-success-icon { color: var(--crm-green); margin-bottom: 16px; }
.crm-success-modal h3 { font-family: 'Playfair Display',serif; font-size: 1.4rem; margin-bottom: 10px; }
.crm-success-modal p { color: #666; margin-bottom: 20px; font-size: 0.88rem; }

/* Listing: tab filter + pagination hide (replaces .hidden for grid cards) */
.crm-vehicle-card.crm-tab-hidden,
.crm-vehicle-card.crm-page-hidden { display: none !important; }

.crm-listing-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 28px;
  padding-top: 8px;
}

.crm-listing-pagination[hidden] { display: none !important; }

.crm-page-btn {
  font-family: var(--crm-font);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 10px;
  border: 1.5px solid var(--crm-border);
  background: white;
  color: #333;
  cursor: pointer;
  transition: border-color .2s, color .2s, background .2s;
}

.crm-page-btn:hover:not(:disabled) {
  border-color: var(--crm-orange);
  color: var(--crm-orange);
}

.crm-page-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.crm-page-info {
  font-size: 0.88rem;
  font-weight: 600;
  color: #555;
  min-width: 4.5em;
  text-align: center;
}

@media (max-width: 680px) {
  .crm-row-1, .crm-row-2 { grid-template-columns: 1fr; }
  .crm-booking-card { padding: 24px 18px; }
  .crm-booking-fields { grid-template-columns: 1fr; }
  .crm-datetime-pair { grid-template-columns: 1fr 1fr; }
}

/* ===== SINGLE VEHICLE LAYOUT ===== */
.crm-single-columns { display: grid; grid-template-columns: 1fr 340px; gap: 28px; align-items:start; }
.crm-single-main { background: transparent; }
.crm-single-image { background: white; border-radius: 14px; padding: 18px; box-shadow: 0 30px 60px rgba(2,6,23,0.12); }
.crm-single-image img { width:100%; height:auto; border-radius:12px; display:block; }
.crm-price-bubble { position:absolute; right:18px; top:12px; background:#111827; color:#fff; padding:10px 14px; border-radius:12px; box-shadow:0 10px 24px rgba(0,0,0,0.18); font-weight:700; }
.crm-single-specs { display:flex; gap:10px; margin:14px 0; }
.crm-spec-item { background:#fff; padding:10px 12px; border-radius:10px; box-shadow:0 6px 18px rgba(2,6,23,0.06); font-weight:600; color:#111; }
.crm-single-description { margin-top:16px; background:white; border-radius:12px; padding:18px; box-shadow: 0 8px 28px rgba(2,6,23,0.04); }
.crm-single-conditions { margin-top:18px; }
.crm-conds-grid { display:flex; gap:12px; }
.cond-item { background:white; border-radius:10px; padding:12px; flex:1; box-shadow:0 6px 18px rgba(2,6,23,0.04); color:#111; }

.crm-single-sidebar { position:relative; }
.crm-booking-panel { background:#111827; color:white; border-radius:12px; padding:18px; box-shadow:0 20px 50px rgba(2,6,23,0.12); }
.crm-booking-header { display:flex; flex-direction:column; gap:6px; margin-bottom:12px; }
.crm-booking-price { font-size:1.32rem; font-weight:800; color:#fb923c; background:#111827; padding:6px 10px; border-radius:8px; }
.crm-booking-sub { color:#9ca3af; font-size:0.9rem; }
.crm-form-field select, .crm-form-field input, .crm-form-field textarea { background:white; color:#111; }
.crm-contact-panel { margin-top:14px; background:transparent; color:white; padding:12px; border-radius:8px; }
.crm-contact-line { padding:8px 6px; color:#e5e7eb; }

@media (max-width: 980px) {
  .crm-single-columns { grid-template-columns: 1fr; }
  .crm-single-sidebar { order: -1; }
}
