/* GO RENTAL RD — Shared Styles | Dark Premium Edition | v=20260801 */

/* ─── RESET & TOKENS ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:         #100f0c;
  --bg-2:       #ffffff;
  --surface:    #ffffff;
  --surface-2:  #fafaf9;
  --border:     rgba(20,18,14,0.09);
  --border-soft:rgba(20,18,14,0.06);
  --glass:      #ffffff;
  --glass-2:    #fafaf9;
  --glass-border: var(--border);
  --ink:        #16140f;
  --ink-soft:   #4a4640;
  --ink-mute:   #837d72;
  /* Text sitting directly on --bg (not inside a --surface card, which keeps
     using --ink/--ink-mute above unchanged) — the page background is now
     dark, so anything not on a white card needs a light color instead. */
  --text-on-bg:      #f5f4f0;
  --text-on-bg-mute: rgba(245,244,240,0.65);
  --accent:     #b8860b;
  --accent-2:   #8a6508;
  --accent-3:   #d4af37;
  --success:    #16a34a;
  --success-bg: #dcfce7;
  --warning:    #d97706;
  --warning-bg: #fef3c7;
  --danger:     #dc2626;
  --danger-bg:  #fee2e2;
  --info:       #2563eb;
  --info-bg:    #dbeafe;
  --radius:     16px;
  --radius-sm:  9px;
  --shadow:     0 1px 2px rgba(20,18,14,0.04), 0 8px 24px rgba(20,18,14,0.06);
  --shadow-lg:  0 8px 16px rgba(20,18,14,0.05), 0 24px 48px rgba(20,18,14,0.12);
  --transition: 0.2s cubic-bezier(0.4,0,0.2,1);
  --sidebar-w:  240px;
  --nav-h:      64px;
  --font-sans:  "Carlito", "Calibri", system-ui, -apple-system, sans-serif;
  --font-display: "Carlito", "Calibri", system-ui, -apple-system, sans-serif;
}

html { overflow-x: clip; scroll-behavior: smooth; }
body { font-family: var(--font-sans); background: var(--bg); color: var(--text-on-bg); min-height: 100vh; line-height: 1.5; }

/* ─── BACKDROP (flat, sober — no animated glow) ─── */
.mesh-bg {
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(ellipse at 15% 0%, rgba(184,134,11,0.05) 0%, transparent 45%),
    var(--bg);
}

/* ─── CARD SURFACE (formerly "glass") ─── */
.glass-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.glass-card-2 {
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
}

/* ─── BUTTONS ─── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 20px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600;
  cursor: pointer; border: none; transition: all var(--transition); text-decoration: none;
  white-space: nowrap;
}
.btn-primary {
  background: var(--ink);
  color: #fff;
  box-shadow: 0 1px 2px rgba(20,18,14,0.08);
}
.btn-primary:hover { background: #2b2820; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(20,18,14,0.18); }
.btn-ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--surface-2); border-color: rgba(20,18,14,0.16); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-icon { padding: 8px; border-radius: var(--radius-sm); }

/* ─── BADGES ─── */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 100px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.01em;
}
.badge-success { background: var(--success-bg); color: #15803d; }
.badge-info    { background: var(--info-bg); color: #1d4ed8; }
.badge-warning { background: var(--warning-bg); color: #b45309; }
.badge-danger  { background: var(--danger-bg); color: #b91c1c; }
.badge-neutral { background: #f1f0ee; color: var(--ink-mute); }

/* ─── FORMS ─── */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.form-control {
  padding: 10px 14px; border-radius: var(--radius-sm); font-size: 14px;
  border: 1.5px solid var(--border); background: var(--surface);
  color: var(--ink); transition: border-color var(--transition), box-shadow var(--transition);
  font-family: var(--font-sans);
}
.form-control:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(184,134,11,0.14); }
.form-control::placeholder { color: #b3ac9f; }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 80px; }

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

/* ─── TABLE ─── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead th {
  padding: 12px 16px; text-align: left; font-size: 12px; font-weight: 700;
  color: var(--ink-mute); text-transform: uppercase; letter-spacing: 0.05em;
  background: var(--surface-2); border-bottom: 1px solid var(--border);
}
tbody td { padding: 14px 16px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; color: var(--ink); }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--surface-2); }

/* ─── MODAL ─── */
.modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 1000;
  background: rgba(20,18,14,0.45); backdrop-filter: blur(3px);
  align-items: center; justify-content: center; padding: 24px;
}
.modal.open .modal-overlay { display: flex; }
.modal-box {
  background: #fff; border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 2px);
  box-shadow: var(--shadow-lg); width: 100%; max-width: 560px;
  max-height: 90vh; overflow-y: auto;
  animation: modalIn 0.22s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes modalIn { from { transform: scale(0.96) translateY(12px); opacity: 0; } }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; border-bottom: 1px solid var(--border-soft);
}
.modal-header h3 { font-size: 17px; font-weight: 700; color: var(--ink); }
.modal-body { padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border-soft); display: flex; gap: 10px; justify-content: flex-end; }
.modal-close { background: none; border: none; cursor: pointer; color: var(--ink-mute); display: inline-flex; align-items: center; justify-content: center; padding: 4px; border-radius: var(--radius-sm); transition: background var(--transition); }
.modal-close:hover { background: var(--surface-2); color: var(--ink); }
.modal-close svg { width: 16px; height: 16px; }

/* ─── TOAST ─── */
.toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
  padding: 12px 18px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 500;
  background: var(--ink); color: #fff; border-left: 3px solid var(--accent-3);
  transform: translateY(16px); opacity: 0; transition: all 0.3s ease;
  max-width: 320px; box-shadow: var(--shadow-lg);
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast-success { border-left-color: #4ade80; }
.toast-error   { border-left-color: #f87171; }
.toast-warning { border-left-color: #fbbf24; }

/* ─── KPI CARDS ─── */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px,1fr)); gap: 16px; }
.kpi-card {
  padding: 20px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.kpi-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-mute); margin-bottom: 8px; }
.kpi-value { font-size: 28px; font-weight: 800; color: var(--ink); line-height: 1; }
.kpi-sub   { font-size: 13px; color: var(--ink-mute); margin-top: 6px; }

/* ─── PAGE HEADER ─── */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.page-title { font-size: 22px; font-weight: 800; color: var(--text-on-bg); }
.page-sub   { font-size: 14px; color: var(--text-on-bg-mute); margin-top: 2px; }

/* ─── SEARCH BAR ─── */
.search-bar { position: relative; }
.search-bar input { width: 260px; }

/* ─── EMPTY STATE ─── */
.empty-state { text-align: center; padding: 60px 24px; color: var(--ink-mute); }
.empty-title { font-size: 16px; font-weight: 600; margin-bottom: 6px; color: var(--ink); }

/* ─── VEHICLE CARD (catalog style) ─── */
.vehicle-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px,1fr)); gap: 20px; }
.vehicle-card {
  border-radius: var(--radius); overflow: hidden;
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  cursor: pointer;
}
.vehicle-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: rgba(20,18,14,0.16); }
.vehicle-thumb {
  height: 190px; display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden; font-size: 64px;
  background: var(--surface-2);
}
.vehicle-thumb-bg { position: absolute; inset: 0; }
.vehicle-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; z-index: 0; }
.v-icon-fallback { font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-mute); }
.vehicle-info { padding: 16px; }
.vehicle-name { font-size: 16px; font-weight: 700; color: var(--ink); }
.vehicle-meta { font-size: 13px; color: var(--ink-mute); margin-top: 4px; }
.vehicle-rate { font-size: 18px; font-weight: 800; color: var(--accent); margin-top: 10px; }
.vehicle-rate span { font-size: 12px; font-weight: 400; color: var(--ink-mute); }
.vehicle-actions { display: flex; gap: 8px; margin-top: 12px; }

/* Floating pill tags on the photo — readable over any image, no dark overlay needed */
.vehicle-tag {
  position: absolute; z-index: 2; display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 700; padding: 4px 9px; border-radius: 100px;
  background: rgba(255,255,255,0.92); color: var(--ink);
  box-shadow: 0 1px 3px rgba(20,18,14,0.15);
  backdrop-filter: blur(4px);
}
.vehicle-tag-plate { bottom: 10px; right: 10px; letter-spacing: 0.04em; }

/* Unavailable vehicle (rentado / mantenimiento) — dark/transparent overlay +
   status tag on the photo. Never hidden from any listing: the public site's
   vehicle count must always match the real fleet in the admin. */
.vehicle-thumb-overlay { position: absolute; inset: 0; z-index: 1; background: rgba(10,9,6,0.55); }
.vehicle-status-tag {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  font-size: 11px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 5px 12px; border-radius: 100px; color: #fff;
  background: rgba(20,18,14,0.85); backdrop-filter: blur(3px);
}
.vehicle-status-tag.tag-mantenimiento { background: rgba(180,120,10,0.9); }

.btn:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

/* ─── AVATAR ─── */
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--ink);
  color: #fff; font-weight: 700; font-size: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* ─── SECTION CARD ─── */
.section-card {
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: var(--radius); padding: 24px;
}
.section-title { font-size: 16px; font-weight: 700; color: var(--ink); margin-bottom: 16px; }

/* ─── FILTER CHIPS (shared by admin + client listings) ─── */
.filter-bar, .filter-row {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 20px;
}
.filter-chip {
  padding: 6px 14px; border-radius: 100px; font-size: 13px; font-weight: 600;
  cursor: pointer; border: 1.5px solid var(--border);
  background: var(--surface); color: var(--ink-mute);
  transition: all var(--transition);
}
.filter-chip:hover { border-color: rgba(20,18,14,0.22); color: var(--ink); }
.filter-chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ─── ACCESSIBILITY ─── */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
  .form-row-2, .form-row-3 { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .search-bar input { width: 180px; }
}
@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; align-items: flex-start; }
}

/* ─── PRINT ─── */
@media print {
  .mesh-bg, .sidebar, .top-nav, .btn, .toast { display: none !important; }
}
