/* ============================================
   SpinRack — Global Styles
   ============================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --black: #0a0a0a;
  --dark: #111111;
  --white: #f5f5f0;
  --accent: #e8ff47;
  --accent-dim: rgba(232, 255, 71, 0.15);
  --muted: #888;
  --muted-light: #666;
  --card-bg: #141414;
  --card-hover: #1a1a1a;
  --border: #222;
  --border-light: #333;
  --danger: #ff4757;
  --success: #2ed573;
  --warning: #f59e0b;
  --star: #ffd32a;
  --radius: 12px;
  --radius-sm: 8px;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--black);
  color: var(--white);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

h1, h2, h3, h4, h5 {
  font-family: 'Space Grotesk', sans-serif;
  letter-spacing: -0.02em;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============================================
   Nav
   ============================================ */
.app-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 32px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(10, 10, 10, 0.9);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.4rem;
  letter-spacing: -0.03em;
  color: var(--white);
  cursor: pointer;
}
.nav-logo span { color: var(--accent); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  padding: 8px 16px;
  font-size: 0.85rem;
  color: var(--muted);
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  cursor: pointer;
}
.nav-link:hover { color: var(--white); text-decoration: none; background: rgba(255,255,255,0.05); }

.nav-btn {
  padding: 8px 20px;
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--accent);
  color: var(--black);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Space Grotesk', sans-serif;
}
.nav-btn:hover { background: #d4eb3f; text-decoration: none; }

.nav-btn-outline {
  background: transparent;
  color: var(--white);
  border: 1px solid var(--border-light);
}
.nav-btn-outline:hover { background: rgba(255,255,255,0.05); border-color: var(--muted); }

/* Hamburger */
.hamburger { display: none; background: none; border: none; color: var(--white); font-size: 1.5rem; cursor: pointer; padding: 4px; }

.mobile-menu {
  display: none;
  position: fixed;
  top: 57px;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--black);
  z-index: 99;
  padding: 24px;
  flex-direction: column;
  gap: 12px;
}
.mobile-menu.active { display: flex; }
.mobile-menu .nav-link { font-size: 1.1rem; padding: 16px; }
.mobile-menu .nav-btn { text-align: center; padding: 16px; font-size: 1rem; }

/* ============================================
   Page Container
   ============================================ */
.page { padding-top: 80px; min-height: 100vh; }

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 32px;
}

.container-sm {
  max-width: 520px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ============================================
   Forms
   ============================================ */
.form-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  margin-top: 40px;
}

.form-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.form-subtitle {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 32px;
}

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  font-size: 0.95rem;
  font-family: 'DM Sans', sans-serif;
  background: var(--black);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--white);
  transition: border-color 0.2s;
}
.form-input:focus {
  outline: none;
  border-color: var(--accent);
}
.form-input::placeholder { color: var(--muted-light); }

textarea.form-input { min-height: 80px; resize: vertical; }

select.form-input {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3e%3cpolyline points='6 9 12 15 18 9'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  cursor: pointer;
}

.form-input-error { border-color: var(--danger) !important; }

/* Role selector */
.role-selector {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 20px;
}

.role-option {
  padding: 16px 12px;
  background: var(--black);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.85rem;
}
.role-option:hover { border-color: var(--muted); }
.role-option.active {
  border-color: var(--accent);
  background: var(--accent-dim);
}
.role-option .role-icon { font-size: 1.5rem; margin-bottom: 8px; }
.role-option .role-label { font-weight: 500; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: 'Space Grotesk', sans-serif;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  gap: 8px;
}

.btn-primary {
  background: var(--accent);
  color: var(--black);
  width: 100%;
}
.btn-primary:hover { background: #d4eb3f; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary {
  background: transparent;
  color: var(--white);
  border: 1px solid var(--border-light);
}
.btn-secondary:hover { background: rgba(255,255,255,0.05); }

.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid rgba(255, 71, 87, 0.3);
}
.btn-danger:hover { background: rgba(255, 71, 87, 0.1); }

.btn-sm { padding: 8px 16px; font-size: 0.8rem; }

.form-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 0.9rem;
  color: var(--muted);
}

.form-error {
  background: rgba(255, 71, 87, 0.1);
  border: 1px solid rgba(255, 71, 87, 0.3);
  color: var(--danger);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  margin-bottom: 16px;
  display: none;
}
.form-error.visible { display: block; }

.form-success {
  background: rgba(46, 213, 115, 0.1);
  border: 1px solid rgba(46, 213, 115, 0.3);
  color: var(--success);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  margin-bottom: 16px;
  display: none;
}
.form-success.visible { display: block; }

/* ============================================
   Profile Page
   ============================================ */
.profile-header {
  display: flex;
  gap: 32px;
  align-items: flex-start;
  padding: 48px 0;
  border-bottom: 1px solid var(--border);
}

.profile-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--card-bg);
  border: 3px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  flex-shrink: 0;
  overflow: hidden;
}
.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-info { flex: 1; }

.profile-name {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.badge-verified {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: rgba(46, 213, 115, 0.15);
  color: var(--success);
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.profile-meta {
  display: flex;
  gap: 24px;
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 8px;
  flex-wrap: wrap;
}

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

.profile-bio {
  margin-top: 16px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  margin-top: 32px;
}

.profile-stat {
  background: var(--card-bg);
  padding: 24px;
  text-align: center;
}
.profile-stat:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.profile-stat:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

.profile-stat-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent);
}

.profile-stat-label {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 4px;
}

/* Stars */
.stars { color: var(--star); letter-spacing: 2px; }
.stars-empty { color: var(--border-light); }

.star-rating {
  display: flex;
  gap: 4px;
}
.star-rating .star {
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--border-light);
  transition: color 0.15s;
}
.star-rating .star.active { color: var(--star); }
.star-rating .star:hover { color: var(--star); }

/* ============================================
   Reviews
   ============================================ */
.reviews-section {
  padding: 48px 0;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.section-title-sm {
  font-size: 1.3rem;
  font-weight: 600;
}

.review-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 12px;
}

.review-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.review-author {
  display: flex;
  align-items: center;
  gap: 12px;
}

.review-author-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.review-author-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.review-author-date {
  font-size: 0.8rem;
  color: var(--muted);
}

.review-stars {
  font-size: 0.9rem;
}

.review-comment {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

.review-type-badge {
  display: inline-flex;
  padding: 2px 8px;
  font-size: 0.7rem;
  border-radius: 100px;
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* ============================================
   Listings
   ============================================ */
.listings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.listing-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.2s;
  cursor: pointer;
}
.listing-card:hover { border-color: var(--border-light); transform: translateY(-2px); }

.listing-card-img {
  width: 100%;
  height: 180px;
  background: var(--dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: var(--border-light);
}

.listing-card-body { padding: 20px; }

.listing-card-category {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 8px;
}

.listing-card-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.listing-card-meta {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 12px;
}

.listing-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.listing-card-price {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--accent);
}

.listing-card-owner {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--muted);
}

/* ============================================
   Empty State
   ============================================ */
.empty-state {
  text-align: center;
  padding: 80px 24px;
  color: var(--muted);
}
.empty-state-icon { font-size: 3rem; margin-bottom: 16px; opacity: 0.5; }
.empty-state-text { font-size: 1.1rem; margin-bottom: 8px; }
.empty-state-sub { font-size: 0.9rem; color: var(--muted-light); }

/* ============================================
   Tabs
   ============================================ */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.tab {
  padding: 12px 20px;
  font-size: 0.9rem;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  font-weight: 500;
}
.tab:hover { color: var(--white); }
.tab.active { color: var(--white); border-bottom-color: var(--accent); }

/* ============================================
   Legal Pages
   ============================================ */
.legal-page {
  padding: 120px 0 80px;
}

.legal-page h1 {
  font-size: 2rem;
  margin-bottom: 32px;
}

.legal-page h2 {
  font-size: 1.3rem;
  margin: 32px 0 12px;
  color: var(--accent);
}

.legal-page p, .legal-page li {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.8;
  margin-bottom: 12px;
}

.legal-page ul {
  padding-left: 24px;
  margin-bottom: 16px;
}

/* ============================================
   Toast
   ============================================ */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 14px 24px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--white);
  font-size: 0.9rem;
  z-index: 1000;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s;
}
.toast.visible { transform: translateY(0); opacity: 1; }
.toast.success { border-color: rgba(46, 213, 115, 0.4); }
.toast.error { border-color: rgba(255, 71, 87, 0.4); }

/* ============================================
   Loading
   ============================================ */
.loading-spinner {
  display: flex;
  justify-content: center;
  padding: 60px;
}
.loading-spinner::after {
  content: '';
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================
   Footer
   ============================================ */
.app-footer {
  padding: 40px 32px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-links {
  display: flex;
  gap: 24px;
  font-size: 0.8rem;
}

.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--white); }

.footer-copy {
  font-size: 0.8rem;
  color: var(--muted);
}

/* ============================================
   Hero Search Bar
   ============================================ */
.hero-search {
  max-width: 680px;
}

.hero-search-bar {
  display: flex;
  gap: 0;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s;
}
.hero-search-bar:focus-within {
  border-color: var(--accent);
}

.hero-search-input {
  flex: 1;
  padding: 16px 20px;
  font-size: 1rem;
  font-family: 'DM Sans', sans-serif;
  background: transparent;
  border: none;
  color: var(--white);
  min-width: 0;
}
.hero-search-input:focus { outline: none; }
.hero-search-input::placeholder { color: var(--muted-light); }

.hero-search-select {
  padding: 16px 12px;
  font-size: 0.85rem;
  font-family: 'DM Sans', sans-serif;
  background: transparent;
  border: none;
  border-left: 1px solid var(--border);
  color: var(--muted);
  cursor: pointer;
  appearance: none;
  min-width: 120px;
}
.hero-search-select:focus { outline: none; color: var(--white); }
.hero-search-select option { background: var(--black); color: var(--white); }

.hero-search-btn {
  padding: 16px 28px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  background: var(--accent);
  color: var(--black);
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}
.hero-search-btn:hover { background: #d4eb3f; }

/* ============================================
   Filter Bar
   ============================================ */
.filter-bar {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 20px;
}

.filter-bar-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.filter-bar-row + .filter-bar-row {
  margin-top: 8px;
}

.filter-search-wrap {
  flex: 1;
  min-width: 200px;
}

.filter-select {
  width: auto;
  min-width: 140px;
}

.filter-price-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-price {
  width: 100px !important;
}

.listing-card-deposit {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 2px;
}

/* ============================================
   Listing Detail Page
   ============================================ */
.detail-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 32px;
  padding-bottom: 64px;
}

.detail-main { min-width: 0; }

.detail-gallery {
  margin-bottom: 32px;
}

.detail-photo-main {
  width: 100%;
  aspect-ratio: 16/10;
  background: var(--dark);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}
.detail-photo-main img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #111;
}
.detail-photo-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  color: var(--border-light);
}

.detail-photo-thumbs {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.detail-thumb {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 2px solid var(--border);
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.2s;
}
.detail-thumb.active,
.detail-thumb:hover {
  border-color: var(--accent);
}
.detail-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-info-section {
  margin-bottom: 24px;
}

.detail-category {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 8px;
}

.detail-title {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 16px;
}

.detail-meta-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.detail-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.82rem;
  color: var(--muted);
}

.detail-section {
  padding: 24px 0;
  border-top: 1px solid var(--border);
}

.detail-section-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.detail-description {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.7;
}

/* Detail Sidebar */
.detail-sidebar {
  position: sticky;
  top: 100px;
  align-self: start;
}

.detail-price-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 16px;
}

.detail-price-main {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 8px;
}

.detail-price-amount {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--accent);
}

.detail-price-period {
  font-size: 1rem;
  color: var(--muted);
}

.detail-deposit {
  font-size: 0.9rem;
  margin-bottom: 16px;
  padding: 8px 12px;
  background: rgba(232,255,71,0.05);
  border-radius: var(--radius-sm);
}

.detail-price-examples {
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.detail-price-line {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--muted);
  padding: 6px 0;
}
.detail-price-line span:last-child {
  font-weight: 600;
  color: var(--white);
}

.detail-owner-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.detail-owner-header {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}

.detail-owner-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
  overflow: hidden;
}
.detail-owner-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-owner-name {
  font-weight: 600;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.detail-owner-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  background: var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.detail-owner-stat {
  background: var(--black);
  padding: 12px 8px;
  text-align: center;
}

.detail-owner-stat-val {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--accent);
}

.detail-owner-stat-label {
  font-size: 0.68rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 2px;
}

/* ============================================
   Availability Calendar
   ============================================ */
.avail-calendar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.avail-weekend {
  display: flex;
  gap: 2px;
  background: var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.avail-day {
  padding: 10px 12px;
  font-size: 0.78rem;
  background: var(--card-bg);
  color: var(--muted);
  text-align: center;
  min-width: 80px;
  cursor: default;
  transition: all 0.15s;
  user-select: none;
}

.avail-day.avail {
  background: rgba(46, 213, 115, 0.12);
  color: var(--success);
}

.avail-day.unavail {
  background: rgba(255, 71, 87, 0.08);
  color: rgba(255, 71, 87, 0.5);
  text-decoration: line-through;
}

/* Editable calendar (create form) */
[id*="create-avail"] .avail-day {
  cursor: pointer;
}
[id*="create-avail"] .avail-day:hover {
  background: rgba(232, 255, 71, 0.1);
  color: var(--white);
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
  .app-nav { padding: 12px 16px; }
  .nav-links { display: none; }
  .hamburger { display: block; }
  .container { padding: 0 16px; }
  .container-sm { padding: 0 16px; }
  .form-card { padding: 24px 20px; margin-top: 24px; }
  .profile-header { flex-direction: column; align-items: center; text-align: center; gap: 20px; padding: 32px 0; }
  .profile-meta { justify-content: center; }
  .profile-stats { grid-template-columns: repeat(2, 1fr); }
  .profile-stat:first-child { border-radius: var(--radius-sm) 0 0 0; }
  .profile-stat:nth-child(2) { border-radius: 0 var(--radius-sm) 0 0; }
  .profile-stat:nth-child(3) { border-radius: 0 0 0 var(--radius-sm); }
  .profile-stat:last-child { border-radius: 0 0 var(--radius-sm) 0; }
  .role-selector { grid-template-columns: 1fr; }
  .listings-grid { grid-template-columns: 1fr; }
  .app-footer { flex-direction: column; text-align: center; padding: 32px 16px; }

  /* Detail page responsive */
  .detail-layout { grid-template-columns: 1fr; gap: 24px; }
  .detail-sidebar { position: static; }
  .detail-title { font-size: 1.5rem; }
  .detail-price-amount { font-size: 1.8rem; }

  /* Hero search responsive */
  .hero-search-bar {
    flex-direction: column;
  }
  .hero-search-select {
    border-left: none;
    border-top: 1px solid var(--border);
    min-width: auto;
  }
  .hero-search-btn {
    border-top: 1px solid rgba(232, 255, 71, 0.2);
  }

  /* Filter bar responsive */
  .filter-bar-row { flex-direction: column; }
  .filter-search-wrap { width: 100%; min-width: auto; }
  .filter-select { width: 100%; }
  .filter-price-wrap { width: 100%; }
  .filter-price { flex: 1; width: auto !important; }

  /* Calendar responsive */
  .avail-calendar { flex-direction: column; }
  .avail-day { min-width: 60px; padding: 8px 6px; font-size: 0.72rem; }

  /* Booking modal responsive */
  .booking-modal { width: 100%; max-height: 100dvh; border-radius: 0; }
  .booking-modal-overlay { align-items: flex-end; }
  .booking-cal-grid { grid-template-columns: repeat(7, 1fr); }
  .booking-cal-day { height: 38px; font-size: 0.82rem; }

  /* Reservation detail responsive */
  .resa-detail-layout { grid-template-columns: 1fr; }
  .resa-dates-row { grid-template-columns: 1fr 1fr; }
  .resa-dates-arrow { display: none; }
}

/* ============================================
   Availability Calendar — Monthly Grid
   ============================================ */

.avail-cal-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.avail-nav-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--white);
  width: 32px; height: 32px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.avail-nav-btn:hover { background: var(--border); }
.avail-nav-label { font-weight: 600; font-size: 0.95rem; }

.avail-month {
  margin-bottom: 24px;
}
.avail-month-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}
.avail-month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}
.avail-dow {
  text-align: center;
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 600;
  padding: 4px 0;
  text-transform: uppercase;
}
.avail-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  border-radius: 6px;
  cursor: default;
  user-select: none;
}
.avail-cell.empty { background: transparent; }
.avail-cell.past { color: #333; }
.avail-cell.avail { background: rgba(34,197,94,0.15); color: #22c55e; font-weight: 500; }
.avail-cell.unavail { background: rgba(255,255,255,0.03); color: #444; text-decoration: line-through; }
.avail-cell.clickable { cursor: pointer; }
.avail-cell.clickable.avail:hover { background: rgba(34,197,94,0.25); }
.avail-cell.clickable.unavail:hover { background: rgba(239,68,68,0.12); }

/* ============================================
   Booking Modal
   ============================================ */

.booking-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.booking-modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 480px;
  max-height: 90dvh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.booking-modal-loading {
  display: flex; align-items: center; justify-content: center; padding: 64px;
}
.booking-modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 0;
  position: sticky;
  top: 0;
  background: var(--bg-card);
  z-index: 1;
  border-bottom: 1px solid var(--border);
  padding-bottom: 16px;
  margin-bottom: 0;
}
.booking-modal-title {
  flex: 1;
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.booking-modal-close, .booking-modal-back {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
}
.booking-modal-close:hover, .booking-modal-back:hover { color: var(--white); background: var(--border); }
.booking-modal-body { padding: 20px; flex: 1; }
.booking-modal-footer {
  padding: 16px 20px 20px;
  border-top: 1px solid var(--border);
  position: sticky;
  bottom: 0;
  background: var(--bg-card);
}

.booking-price-hint {
  text-align: center;
  margin-bottom: 16px;
}
.booking-price-big { font-size: 1.6rem; font-weight: 800; }
.booking-price-unit { font-size: 0.9rem; color: var(--muted); }

.booking-cal-nav {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  margin-bottom: 12px;
}
.booking-cal-nav-btn {
  background: var(--surface); border: 1px solid var(--border);
  color: var(--white); width: 32px; height: 32px; border-radius: 6px;
  cursor: pointer; font-size: 1.2rem; line-height: 1;
  transition: background 0.15s;
}
.booking-cal-nav-btn:hover { background: var(--border); }
.booking-cal-month { font-weight: 700; font-size: 0.95rem; min-width: 140px; text-align: center; }

.booking-cal { margin-bottom: 12px; }
.booking-cal-head {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px;
  margin-bottom: 4px;
}
.booking-cal-dow {
  text-align: center; font-size: 0.7rem; color: var(--muted); font-weight: 600;
  padding: 4px 0; text-transform: uppercase;
}
.booking-cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px;
}
.booking-cal-day {
  aspect-ratio: 1;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  font-size: 0.85rem;
  cursor: default;
  user-select: none;
  position: relative;
  transition: background 0.12s;
}
.booking-cal-day.empty { background: transparent; }
.booking-cal-day.disabled { color: #333; }
.booking-cal-day.disabled.booked { color: #3a2020; background: rgba(239,68,68,0.05); }
.booking-cal-day.selectable { cursor: pointer; color: var(--white); }
.booking-cal-day.selectable:hover { background: rgba(232,255,71,0.12); }
.booking-cal-day.sel-edge {
  background: var(--accent) !important;
  color: #000 !important;
  font-weight: 700;
}
.booking-cal-day.sel-in-range {
  background: rgba(232,255,71,0.15);
  border-radius: 0;
}

.booking-summary-mini {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  margin-top: 12px;
}
.booking-sum-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 4px 0; font-size: 0.88rem;
}
.booking-sum-row span { color: var(--muted); }
.booking-sum-deposit { color: #f59e0b; }
.booking-sum-hint { font-size: 0.85rem; color: var(--muted); text-align: center; padding: 4px 0; }

/* Confirm step */
.booking-recap-listing {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; background: var(--surface); border-radius: 10px; margin-bottom: 16px;
}
.booking-recap-photo {
  width: 60px; height: 60px; border-radius: 8px; object-fit: cover; flex-shrink: 0;
}
.booking-recap-title { font-weight: 600; font-size: 0.95rem; }

.booking-recap-dates {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border-radius: 10px; padding: 12px 16px; margin-bottom: 16px;
}
.booking-recap-date-col { text-align: center; flex: 1; }
.booking-recap-date-label { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 4px; }
.booking-recap-date-val { font-weight: 700; font-size: 0.9rem; }
.booking-recap-arrow { font-size: 1.2rem; color: var(--muted); }

.booking-breakdown {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 16px; margin-bottom: 16px;
}
.booking-breakdown-row {
  display: flex; justify-content: space-between; padding: 6px 0; font-size: 0.88rem; color: var(--muted);
}
.booking-breakdown-deposit { color: #f59e0b; }
.booking-breakdown-total {
  display: flex; justify-content: space-between;
  padding-top: 12px; margin-top: 8px; border-top: 1px solid var(--border);
  font-weight: 700; font-size: 1rem;
}

.booking-payment-note {
  background: rgba(34,197,94,0.06); border: 1px solid rgba(34,197,94,0.15); border-radius: 10px;
  padding: 12px 16px; margin-bottom: 16px; font-size: 0.85rem; color: var(--muted);
}
.booking-notes-group { margin-bottom: 4px; }

/* ============================================
   Reservation List (Mes résas / Demandes)
   ============================================ */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 32px 0 20px;
}
.page-title { font-size: 1.6rem; font-weight: 800; margin: 0; }

.resa-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 40px; }

.resa-card {
  display: flex; align-items: center; gap: 16px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px;
  padding: 16px; cursor: pointer; transition: border-color 0.15s, transform 0.1s;
}
.resa-card:hover { border-color: var(--accent); transform: translateY(-1px); }

.resa-card-photo {
  width: 72px; height: 72px; border-radius: 10px; overflow: hidden; flex-shrink: 0;
  background: var(--surface); display: flex; align-items: center; justify-content: center;
}
.resa-card-photo img { width: 100%; height: 100%; object-fit: cover; }
.resa-no-photo { font-size: 2rem; }

.resa-card-body { flex: 1; min-width: 0; }
.resa-card-title { font-weight: 700; font-size: 0.95rem; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.resa-card-dates { font-size: 0.82rem; color: var(--muted); margin-bottom: 2px; }

.resa-card-price { text-align: right; flex-shrink: 0; }

/* ============================================
   Reservation Detail
   ============================================ */
.resa-detail-layout {
  display: grid; grid-template-columns: 1fr 360px; gap: 32px;
  padding: 0 0 60px;
}

.resa-detail-listing {
  display: flex; align-items: center; gap: 16px;
  padding: 16px; background: var(--surface); border-radius: 12px; margin-bottom: 24px;
}
.resa-detail-photo { width: 72px; height: 72px; border-radius: 10px; object-fit: cover; flex-shrink: 0; }
.resa-detail-listing-title { font-weight: 700; font-size: 1rem; margin-bottom: 4px; }

.resa-detail-section { margin-bottom: 28px; }
.resa-detail-section-title {
  font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted); margin: 0 0 16px;
}

.resa-dates-row {
  display: grid; grid-template-columns: 1fr auto 1fr 1fr; align-items: center;
  gap: 12px;
}
.resa-date-box {
  background: var(--surface); border-radius: 10px; padding: 12px 16px; text-align: center;
}
.resa-date-label { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; }
.resa-date-val { font-weight: 700; font-size: 0.9rem; }
.resa-dates-arrow { font-size: 1.4rem; color: var(--muted); text-align: center; }

/* Timeline */
.resa-timeline { display: flex; flex-direction: column; gap: 0; }
.resa-timeline-step {
  display: flex; align-items: flex-start; gap: 16px;
  padding: 12px 0;
  position: relative;
}
.resa-timeline-step:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 9px; top: 28px;
  width: 2px; height: calc(100% - 12px);
  background: var(--border);
}
.resa-timeline-step.done::after { background: var(--accent); }
.resa-timeline-dot {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid var(--border); background: var(--bg-card);
  flex-shrink: 0; margin-top: 2px; position: relative; z-index: 1;
  transition: border-color 0.2s, background 0.2s;
}
.resa-timeline-step.done .resa-timeline-dot {
  border-color: var(--accent); background: var(--accent);
}
.resa-timeline-label { font-size: 0.9rem; padding-top: 1px; }
.resa-timeline-step:not(.done) .resa-timeline-label { color: var(--muted); }
.resa-timeline-ts {
  display: block; font-size: 0.75rem; color: var(--muted); margin-top: 2px;
}

/* Breakdown in sidebar */
.resa-status-card, .resa-person-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px;
  padding: 20px; margin-bottom: 16px;
}
.resa-breakdown { display: flex; flex-direction: column; gap: 0; }
.resa-breakdown-row {
  display: flex; justify-content: space-between; padding: 6px 0; font-size: 0.88rem;
}
.resa-breakdown-row span:first-child { color: var(--muted); }
.resa-breakdown-deposit span:first-child { color: #f59e0b; }
.resa-breakdown-total {
  display: flex; justify-content: space-between;
  padding-top: 12px; margin-top: 8px; border-top: 1px solid var(--border);
  font-weight: 700; font-size: 1rem;
}
.resa-person-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--surface); display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1rem; overflow: hidden; flex-shrink: 0;
}
.resa-person-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* Actions */
.resa-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.btn-danger {
  background: rgba(239,68,68,0.1); color: #ef4444;
  border: 1px solid rgba(239,68,68,0.3); border-radius: var(--radius-sm);
  padding: 10px 20px; font-weight: 600; cursor: pointer; font-size: 0.9rem;
  transition: background 0.15s, transform 0.1s;
}
.btn-danger:hover { background: rgba(239,68,68,0.2); transform: translateY(-1px); }
