/* ============================================================
   ANTIQUARIUS — STYLES v2
   Design inspiré des maisons d'antiquités haut de gamme
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;500;600;700&family=DM+Sans:wght@300;400;500;600;700&display=swap');

:root {
  --sidebar-w: 260px;
  --bg: #fafaf7;
  --bg-warm: #f5f3ee;
  --card: #ffffff;
  --sidebar: #1a1612;
  --sidebar-text: #c9c4b8;
  --sidebar-muted: #6b665a;
  --gold: #c9a84c;
  --gold-light: #e0c878;
  --gold-dark: #a08534;
  --brown: #8b5a2b;
  --brown-dark: #5d3a18;
  --text: #1f1a14;
  --text-soft: #4a4339;
  --muted: #8a8170;
  --border: #e8e3d6;
  --border-strong: #d4cdb8;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
  --shadow: 0 4px 16px rgba(0,0,0,0.06);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.12);
  --radius: 8px;
  --radius-lg: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  line-height: 1.5;
}

/* ============== SIDEBAR ============== */
#sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
  border-right: 1px solid #2a2620;
}

.brand {
  padding: 28px 24px 22px;
  border-bottom: 1px solid #2a2620;
}

.brand-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 26px;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: 1px;
  line-height: 1;
}

.brand-sub {
  font-size: 9.5px;
  color: var(--sidebar-muted);
  text-transform: uppercase;
  letter-spacing: 3px;
  margin-top: 6px;
  font-weight: 500;
}

.brand-version {
  font-size: 10px;
  color: var(--sidebar-muted);
  margin-top: 4px;
  font-style: italic;
}

nav { padding: 14px 0 24px; flex: 1; }

.nav-section-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--sidebar-muted);
  font-weight: 600;
  padding: 16px 24px 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 24px;
  color: var(--sidebar-text);
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 400;
  border-left: 3px solid transparent;
  transition: all 0.15s;
  user-select: none;
  position: relative;
}

.nav-item:hover {
  background: rgba(255,255,255,0.03);
  color: #fff;
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(201,168,76,0.15) 0%, transparent 100%);
  color: var(--gold);
  border-left-color: var(--gold);
  font-weight: 500;
}

.nav-icon {
  font-size: 17px;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}

.nav-badge {
  margin-left: auto;
  background: rgba(201,168,76,0.2);
  color: var(--gold);
  padding: 2px 7px;
  border-radius: 99px;
  font-size: 10.5px;
  font-weight: 600;
  min-width: 22px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px 24px 20px;
  border-top: 1px solid #2a2620;
  font-size: 11px;
  color: var(--sidebar-muted);
}

.sidebar-footer-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold) 0%, var(--brown) 100%);
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-info { flex: 1; min-width: 0; }
.user-name { color: var(--sidebar-text); font-size: 12.5px; font-weight: 500; }
.user-role { font-size: 10.5px; }

/* ============== MAIN ============== */
#main { flex: 1; overflow-y: auto; display: flex; flex-direction: column; }

.topbar {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 14px 36px;
  display: flex;
  align-items: center;
  gap: 20px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-search {
  flex: 1;
  max-width: 480px;
  position: relative;
}

.topbar-search input {
  width: 100%;
  padding: 9px 14px 9px 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  background: var(--bg-warm);
  outline: none;
  transition: all 0.15s;
}

.topbar-search input:focus { border-color: var(--gold); background: #fff; }

.topbar-search::before {
  content: "🔍";
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  opacity: 0.5;
}

.topbar-actions { display: flex; align-items: center; gap: 8px; }

.btn {
  padding: 8px 16px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn:hover { border-color: var(--gold); }
.btn-primary {
  background: var(--text);
  color: #fff;
  border-color: var(--text);
}
.btn-primary:hover { background: var(--brown-dark); }
.btn-gold {
  background: var(--gold);
  color: var(--text);
  border-color: var(--gold);
}
.btn-gold:hover { background: var(--gold-dark); color: #fff; }
.btn-sm { padding: 5px 10px; font-size: 12px; }

#main-content {
  padding: 28px 36px 60px;
  max-width: 1400px;
  width: 100%;
}

/* ============== HEADERS ============== */
.view-header {
  margin-bottom: 24px;
}

.view-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 34px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.5px;
  margin-bottom: 4px;
}

.view-subtitle {
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
}

.section-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--border) 0%, transparent 100%);
}

/* ============== STATS GRID ============== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 30px;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--accent, var(--gold));
  opacity: 0.8;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-strong);
}

.stat-icon {
  font-size: 22px;
  margin-bottom: 10px;
  opacity: 0.7;
}

.stat-value {
  font-family: 'Cormorant Garamond', serif;
  font-size: 38px;
  font-weight: 600;
  line-height: 1;
  color: var(--text);
}

.stat-label {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 500;
}

.stat-meta {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}

/* Tints for stats */
.stat-card.tint-green { --accent: #16a34a; }
.stat-card.tint-blue { --accent: #2563eb; }
.stat-card.tint-orange { --accent: #ea580c; }
.stat-card.tint-purple { --accent: #9333ea; }
.stat-card.tint-yellow { --accent: #ca8a04; }
.stat-card.tint-red { --accent: #dc2626; }
.stat-card.tint-gold { --accent: var(--gold); }

/* ============== CARDS / PANELS ============== */
.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}

.panel-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 18px;
  margin-bottom: 24px;
}

/* ============== STATUS BADGES ============== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  letter-spacing: 0.2px;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ============== FLOOR PLAN ============== */
.floor-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}

.floor-tab {
  padding: 12px 22px;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  position: relative;
  bottom: -1px;
}

.floor-tab:hover { color: var(--text); }
.floor-tab.active {
  color: var(--text);
  border-bottom-color: var(--gold);
}

.floor-tab-short {
  font-family: 'Cormorant Garamond', serif;
  font-size: 16px;
  font-weight: 600;
}
.floor-tab-name { font-size: 11px; opacity: 0.85; }

.rooms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}

.room-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 16px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.room-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 100%;
  height: 3px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s;
}

.room-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.room-card:hover::after { transform: scaleX(1); }
.room-card.selected {
  background: #fdfaf0;
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(201,168,76,0.2);
}

.room-icon { font-size: 32px; margin-bottom: 10px; }
.room-name {
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 4px;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.room-count {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  line-height: 1;
}
.room-count-label {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 2px;
}
.room-status-bar {
  display: flex;
  gap: 3px;
  justify-content: center;
  margin-top: 10px;
  flex-wrap: wrap;
}
.room-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.room-displaced-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #fee2e2;
  color: #991b1b;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
}

/* ============== ROOM ITEMS PANEL ============== */
.room-detail-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-top: 22px;
}

.room-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.room-detail-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 24px;
  font-weight: 600;
}

.room-stats {
  display: flex;
  gap: 24px;
  font-size: 12px;
  color: var(--muted);
}
.room-stat strong {
  color: var(--text);
  font-size: 16px;
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600;
  display: block;
}

/* ============== ITEM CARDS ============== */
.items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.item-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s;
}

.item-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-strong);
}

.item-card-image {
  height: 180px;
  background: var(--photo-gradient, linear-gradient(135deg, #d4c5a8 0%, #a08766 100%));
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.item-card-image::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.15) 0%, transparent 60%);
}

.item-card-image-icon {
  font-size: 64px;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.2));
  opacity: 0.85;
}

.item-card-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  backdrop-filter: blur(8px);
  background: rgba(255,255,255,0.9);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
}

.item-card-body { padding: 16px; }

.item-card-id {
  font-size: 10.5px;
  color: var(--muted);
  font-family: 'DM Mono', monospace;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.item-card-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.25;
  margin-bottom: 10px;
  min-height: 44px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.item-card-meta {
  font-size: 11.5px;
  color: var(--muted);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.item-card-meta-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.item-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.item-card-price {
  font-family: 'Cormorant Garamond', serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--brown);
}

.item-card-price-na {
  color: var(--muted);
  font-style: italic;
  font-size: 13px;
}

.item-card-location {
  font-size: 11px;
  color: var(--muted);
}

/* ============== FILTERS ============== */
.filters-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filter-select, .filter-input {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  background: var(--card);
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s;
}
.filter-select:focus, .filter-input:focus { border-color: var(--gold); }

.view-toggle {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.view-toggle button {
  padding: 7px 12px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  color: var(--muted);
}
.view-toggle button.active {
  background: var(--text);
  color: #fff;
}

/* ============== MOVEMENTS LIST ============== */
.movement-list { display: flex; flex-direction: column; gap: 6px; }

.movement-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.1s;
  border-bottom: 1px solid var(--bg-warm);
}
.movement-item:hover { background: var(--bg-warm); }

.mov-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
  background: var(--gold);
}
.mov-dot.sold { background: #6b7280; }
.mov-dot.rental { background: #eab308; }

.mov-content { flex: 1; min-width: 0; }
.mov-title {
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 3px;
}
.mov-meta {
  display: flex;
  gap: 10px;
  font-size: 11px;
  color: var(--muted);
}
.mov-route {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
}
.mov-route .arrow { color: var(--gold); font-weight: 600; }
.mov-note {
  font-size: 11px;
  color: var(--muted);
  font-style: italic;
  margin-top: 4px;
}

/* ============== ALERT BOX ============== */
.alert-box {
  background: #fff8e6;
  border: 1px solid #f0d28a;
  border-left: 4px solid var(--gold);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13.5px;
}

/* ============== TIMELINE ============== */
.timeline {
  position: relative;
  padding-left: 28px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  margin-bottom: 16px;
  padding-bottom: 16px;
}

.timeline-dot {
  position: absolute;
  left: -28px;
  top: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--gold);
  border: 3px solid var(--card);
  box-shadow: 0 0 0 1px var(--border);
}
.timeline-dot.sold { background: #6b7280; }
.timeline-dot.rental { background: #eab308; }

.timeline-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  cursor: pointer;
  transition: box-shadow 0.15s;
}
.timeline-card:hover { box-shadow: var(--shadow); }

.timeline-date {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
}

/* ============== MODAL ============== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--card);
  border-radius: 14px;
  max-height: 92vh;
  overflow-y: auto;
  width: 100%;
  max-width: 920px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.4);
  animation: slideUp 0.25s;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal-hero {
  height: 220px;
  background: var(--photo-gradient, linear-gradient(135deg, #d4c5a8 0%, #a08766 100%));
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.modal-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.15) 0%, transparent 60%);
}

.modal-hero-icon {
  font-size: 100px;
  filter: drop-shadow(0 6px 20px rgba(0,0,0,0.25));
  opacity: 0.9;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255,255,255,0.95);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  transition: background 0.15s;
}
.modal-close:hover { background: #fff; }

.modal-header {
  padding: 24px 32px 16px;
  border-bottom: 1px solid var(--border);
}

.modal-id-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.modal-id {
  font-size: 11.5px;
  color: var(--muted);
  font-family: 'DM Mono', monospace;
  letter-spacing: 0.5px;
}

.modal-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 30px;
  font-weight: 600;
  line-height: 1.15;
  margin-bottom: 12px;
  color: var(--text);
}

.modal-meta-row {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 14px;
}

.modal-meta-item { display: flex; align-items: center; gap: 6px; }

.modal-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
}

.modal-tab {
  padding: 14px 18px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  transition: all 0.15s;
}
.modal-tab:hover { color: var(--text); }
.modal-tab.active {
  color: var(--text);
  border-bottom-color: var(--gold);
}

.modal-body { padding: 26px 32px 32px; }

.detail-section { margin-bottom: 26px; }
.detail-section:last-child { margin-bottom: 0; }

.detail-section h4 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 24px;
}

.detail-row {
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.detail-label {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

.detail-value {
  font-weight: 500;
}

.detail-value.price {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--brown);
}

.detail-value.price-pa {
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}

.description-block {
  background: var(--bg-warm);
  border-left: 3px solid var(--gold);
  padding: 14px 18px;
  border-radius: 0 6px 6px 0;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--text-soft);
  font-style: italic;
}

.certificate-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.certificate-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fdfaf0;
  border: 1px solid #e8d99a;
  color: #5d4a14;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12px;
}

.action-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--bg-warm);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11.5px;
  font-family: 'DM Mono', monospace;
  color: var(--text-soft);
}

/* ============== CLIENTS ============== */
.client-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}

.client-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  gap: 14px;
  transition: all 0.15s;
  cursor: pointer;
}

.client-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}

.client-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold) 0%, var(--brown) 100%);
  color: #fff;
  font-weight: 600;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.client-info { flex: 1; min-width: 0; }
.client-name { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.client-location { font-size: 11.5px; color: var(--muted); margin-bottom: 8px; }
.client-stats { display: flex; gap: 14px; font-size: 11.5px; color: var(--muted); }
.client-stats strong { color: var(--text); }
.client-prefs {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.pref-chip {
  background: var(--bg-warm);
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 10.5px;
  color: var(--text-soft);
}

/* ============== RENTAL CARDS ============== */
.rental-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 4px solid #eab308;
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 12px;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 24px;
  align-items: center;
}

.rental-details { font-size: 13px; }
.rental-item-name { font-weight: 600; margin-bottom: 4px; }
.rental-purpose { color: var(--muted); font-size: 11.5px; margin-bottom: 6px; }
.rental-dates { font-size: 12px; color: var(--text-soft); }
.rental-price {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--brown);
}

/* ============== EMPTY ============== */
.empty {
  text-align: center;
  color: var(--muted);
  padding: 60px 20px;
  font-style: italic;
}

/* ============== NOTIFICATION ============== */
.notification {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--text);
  color: #fff;
  padding: 14px 22px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  transform: translateY(80px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 200;
  box-shadow: var(--shadow-lg);
  max-width: 360px;
}
.notification.show { transform: translateY(0); opacity: 1; }
.notification.warn { background: #92400e; }
.notification.success { background: #14532d; }

/* ============================================================
   SCAN MODAL — QR & NFC
   ============================================================ */

.scan-modal {
  background: var(--card);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 460px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.4);
  animation: slideUp 0.22s;
  overflow: hidden;
}

.scan-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
}

.scan-modal-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.3px;
}

/* ---- Tabs ---- */
.scan-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
}

.scan-tab {
  padding: 13px 20px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
  transition: all 0.15s;
  margin-bottom: -1px;
}
.scan-tab:hover { color: var(--text); }
.scan-tab.active {
  color: var(--text);
  border-bottom-color: var(--gold);
}

/* ---- Body ---- */
.scan-body {
  padding: 28px 24px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 320px;
}

/* ---- QR viewfinder ---- */
.scan-viewfinder-wrap {
  position: relative;
  width: 260px;
  height: 260px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 0 0 1px var(--border);
}

.scan-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #111;
}

.scan-viewfinder {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* Golden corner markers */
.scan-corner {
  position: absolute;
  width: 26px;
  height: 26px;
  border-color: var(--gold);
  border-style: solid;
}
.scan-corner.tl { top: 10px; left: 10px;   border-width: 3px 0 0 3px; border-radius: 3px 0 0 0; }
.scan-corner.tr { top: 10px; right: 10px;  border-width: 3px 3px 0 0; border-radius: 0 3px 0 0; }
.scan-corner.bl { bottom: 10px; left: 10px;  border-width: 0 0 3px 3px; border-radius: 0 0 0 3px; }
.scan-corner.br { bottom: 10px; right: 10px; border-width: 0 3px 3px 0; border-radius: 0 0 3px 0; }

/* Scanning laser line */
.scan-laser {
  position: absolute;
  left: 12px;
  right: 12px;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--gold) 40%, var(--gold-light) 50%, var(--gold) 60%, transparent 100%);
  border-radius: 2px;
  animation: scanLaser 2.4s ease-in-out infinite;
  box-shadow: 0 0 8px rgba(201,168,76,0.7);
}

@keyframes scanLaser {
  0%   { top: 12px; opacity: 0; }
  8%   { opacity: 1; }
  92%  { opacity: 1; }
  100% { top: calc(100% - 14px); opacity: 0; }
}

.scan-hint {
  margin-top: 16px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  line-height: 1.5;
}

/* ---- Fallback (no BarcodeDetector or camera denied) ---- */
.scan-fallback {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.scan-fallback-icon {
  font-size: 52px;
  opacity: 0.4;
  margin-bottom: 4px;
}

.scan-fallback-note {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  line-height: 1.5;
}

.scan-input {
  width: 100%;
  padding: 11px 16px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-family: 'DM Mono', monospace;
  font-size: 14px;
  background: var(--bg-warm);
  outline: none;
  text-align: center;
  letter-spacing: 1px;
  transition: border-color 0.15s, background 0.15s;
}
.scan-input:focus {
  border-color: var(--gold);
  background: #fff;
}

.scan-recent {
  width: 100%;
  margin-top: 4px;
}

.scan-recent-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 8px;
  text-align: left;
}

.scan-recent-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 240px;
  overflow-y: auto;
}

.scan-recent-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.12s;
  background: var(--card);
}
.scan-recent-item:hover {
  border-color: var(--gold);
  background: #fdfaf0;
}

.scan-recent-id {
  font-family: 'DM Mono', monospace;
  font-size: 10.5px;
  color: var(--muted);
  flex-shrink: 0;
  letter-spacing: 0.3px;
}

.scan-recent-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---- NFC simulation ---- */
.scan-nfc {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 20px 0 8px;
}

.scan-nfc-ring {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(201,168,76,0.07);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* Two ripple rings */
.scan-nfc-ring::before,
.scan-nfc-ring::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  border: 2px solid rgba(201,168,76,0.55);
  border-radius: 50%;
  animation: nfcRipple 1.8s ease-out infinite;
}
.scan-nfc-ring::after { animation-delay: 0.9s; }

.scan-nfc-inner {
  font-size: 52px;
  z-index: 1;
  animation: nfcBob 1.8s ease-in-out infinite;
}

@keyframes nfcRipple {
  0%   { transform: scale(1);    opacity: 0.7; }
  100% { transform: scale(2.2);  opacity: 0;   }
}

@keyframes nfcBob {
  0%, 100% { transform: translateY(0);  }
  50%       { transform: translateY(-5px); }
}

.scan-nfc-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  text-align: center;
}

.scan-nfc-sub {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  font-style: italic;
  line-height: 1.5;
}

/* ============== RESPONSIVE ============== */
@media (max-width: 900px) {
  :root { --sidebar-w: 64px; }
  .brand, .nav-section-title, .nav-item span:not(.nav-icon):not(.nav-badge), .sidebar-footer { display: none; }
  .nav-item { justify-content: center; padding: 14px; }
  .nav-icon { font-size: 22px; }
  .panel-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .modal-body { padding: 20px; }
  #main-content { padding: 18px; }
  .topbar { padding: 12px 18px; }
}
