/* ═══════════════════════════════════════════════════════════════════════
   GESTION IMMOBILIÈRE — Interface admin
   Palette alignée avec la marque Entreposage Shawinigan
   ═══════════════════════════════════════════════════════════════════════ */

:root {
  /* ── Palette de marque ── */
  --primary:      #606660;
  --primary-d:    #555c56;
  --primary-dd:   #3d4440;
  --primary-l:    #737a72;
  --accent:       #c9b8a4;
  --accent-d:     #a89478;
  --accent-l:     #f5efe8;

  /* ── Actions ── */
  --success:      #16a34a;
  --success-bg:   #dcfce7;
  --warning:      #d97706;
  --warning-bg:   #fef3c7;
  --danger:       #dc2626;
  --danger-bg:    #fee2e2;
  --info:         #0284c7;
  --info-bg:      #e0f2fe;

  /* ── Surfaces ── */
  --bg:           #f6f5f1;
  --surface:      #ffffff;
  --surface-2:    #fafaf7;
  --border:       #e6e8e3;
  --border-l:     #f0f1ec;

  /* ── Texte ── */
  --text:         #1a1f1c;
  --text-2:       #475056;
  --text-muted:   #6b7280;

  /* ── UI ── */
  --sidebar-width: 250px;
  --radius:        12px;
  --radius-sm:     8px;
  --radius-lg:     16px;
  --shadow-xs:     0 1px 2px rgba(60,66,55,.04);
  --shadow:        0 1px 3px rgba(60,66,55,.07), 0 1px 2px rgba(60,66,55,.04);
  --shadow-md:     0 4px 12px rgba(60,66,55,.08), 0 2px 4px rgba(60,66,55,.05);
  --shadow-lg:     0 16px 36px rgba(60,66,55,.12), 0 6px 12px rgba(60,66,55,.06);
  --shadow-xl:     0 28px 56px rgba(60,66,55,.16), 0 10px 20px rgba(60,66,55,.08);
  --ease:          cubic-bezier(.22,.61,.36,1);

  /* ── Variables compat (anciens noms) ── */
  --primary-dark:  var(--primary-dd);
  --secondary:     var(--text-2);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 { font-family: 'Outfit', 'Inter', sans-serif; letter-spacing: -.02em; }

/* ═══════════════════════════════════════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════════════════════════════════════ */
#sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, var(--primary-dd) 0%, #2f3431 100%);
  color: #d8dcd5;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  height: 100vh;
  border-right: 1px solid rgba(255,255,255,.04);
  box-shadow: 1px 0 0 rgba(0,0,0,.04);
}

.sidebar-logo {
  padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  position: relative;
}
.sidebar-logo::after {
  content: ''; position: absolute; bottom: -1px; left: 20px; right: 20px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent) 50%, transparent);
  opacity: .35;
}
.sidebar-logo h2 {
  font-family: 'Outfit';
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.25;
  letter-spacing: -.02em;
}
.sidebar-logo span {
  font-size: .7rem;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: .04em;
}

nav {
  flex: 1;
  padding: 14px 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.1) transparent;
}
nav::-webkit-scrollbar { width: 6px; }
nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.08); border-radius: 6px; }

nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 20px;
  margin: 1px 10px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,.7);
  text-decoration: none;
  font-size: .87rem;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: all .18s var(--ease);
  cursor: pointer;
  position: relative;
}
nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
nav a.active {
  background: linear-gradient(90deg, rgba(201,184,164,.15), rgba(201,184,164,.05));
  color: #fff;
  border-left-color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(201,184,164,.12);
}
nav a.active::before {
  content: ''; position: absolute; left: -10px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 24px; background: var(--accent); border-radius: 0 3px 3px 0;
}
nav a .icon { font-size: 1.05rem; width: 22px; text-align: center; }

.nav-section {
  padding: 18px 22px 6px;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255,255,255,.4);
}

/* ═══════════════════════════════════════════════════════════════════════
   MAIN CONTENT
   ═══════════════════════════════════════════════════════════════════════ */
#main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 14px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
#topbar h1 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
}

#page-content {
  flex: 1;
  overflow-y: auto;
  padding: 26px;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,.15) transparent;
}
#page-content::-webkit-scrollbar { width: 8px; }
#page-content::-webkit-scrollbar-thumb { background: rgba(0,0,0,.12); border-radius: 8px; }

/* ═══════════════════════════════════════════════════════════════════════
   STAT CARDS
   ═══════════════════════════════════════════════════════════════════════ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px;
  margin-bottom: 26px;
}

.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  transition: all .25s var(--ease);
}
.stat-card::before {
  content: '';
  position: absolute; top: 0; left: 0; bottom: 0;
  width: 4px;
  background: var(--primary);
  border-radius: 4px 0 0 4px;
}
.stat-card.success::before { background: var(--success); }
.stat-card.warning::before { background: var(--warning); }
.stat-card.danger::before  { background: var(--danger); }
.stat-card.secondary::before { background: var(--accent-d); }
.stat-card.clickable { cursor: pointer; }
.stat-card.clickable:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(96,102,96,.25);
}

.stat-card .label {
  font-size: .73rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .07em;
}
.stat-card .value {
  font-family: 'Outfit';
  font-size: 2.1rem;
  font-weight: 800;
  margin: 6px 0 3px;
  color: var(--text);
  letter-spacing: -.02em;
  line-height: 1;
}
.stat-card .sub {
  font-size: .8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ═══════════════════════════════════════════════════════════════════════
   CARDS & TABLES
   ═══════════════════════════════════════════════════════════════════════ */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  overflow: hidden;
  margin-bottom: 22px;
}

.card-header {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--surface-2);
}
.card-header h3 {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
}
thead th {
  background: var(--surface-2);
  padding: 11px 18px;
  text-align: left;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
tbody tr {
  border-bottom: 1px solid var(--border-l);
  transition: background .15s;
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--surface-2); }
td { padding: 13px 18px; vertical-align: middle; color: var(--text-2); }

/* ═══════════════════════════════════════════════════════════════════════
   BADGES
   ═══════════════════════════════════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.badge-available, .badge-active, .badge-synced { background: var(--success-bg); color: #15803d; }
.badge-occupied, .badge-late                   { background: var(--danger-bg); color: #b91c1c; }
.badge-reserved, .badge-unsynced               { background: var(--warning-bg); color: #92400e; }
.badge-residential                             { background: #ede9fe; color: #5b21b6; }
.badge-storage                                 { background: #fef9c3; color: #854d0e; }
.badge-waitlist                                { background: #ffedd5; color: #9a3412; }

/* ═══════════════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 17px;
  border-radius: var(--radius-sm);
  font-size: .85rem;
  font-weight: 600;
  font-family: inherit;
  border: none;
  cursor: pointer;
  transition: all .18s var(--ease);
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: -.005em;
}
.btn:active { transform: scale(.97); }

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-d));
  color: #fff;
  box-shadow: 0 2px 6px rgba(85,92,86,.25);
}
.btn-primary:hover {
  box-shadow: 0 6px 14px rgba(85,92,86,.35);
  transform: translateY(-1px);
}

.btn-success {
  background: linear-gradient(135deg, #16a34a, #15803d);
  color: #fff;
  box-shadow: 0 2px 6px rgba(22,163,74,.25);
}
.btn-success:hover { box-shadow: 0 6px 14px rgba(22,163,74,.35); transform: translateY(-1px); }

.btn-danger {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  color: #fff;
  box-shadow: 0 2px 6px rgba(220,38,38,.25);
}
.btn-danger:hover { box-shadow: 0 6px 14px rgba(220,38,38,.35); transform: translateY(-1px); }

.btn-warning {
  background: linear-gradient(135deg, var(--warning), #b45309);
  color: #fff;
  box-shadow: 0 2px 6px rgba(217,119,6,.25);
}
.btn-warning:hover { box-shadow: 0 6px 14px rgba(217,119,6,.35); transform: translateY(-1px); }

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--surface-2); border-color: rgba(96,102,96,.3); }

.btn-sm   { padding: 6px 11px; font-size: .77rem; }
.btn-icon { padding: 6px; border-radius: 7px; }

/* ═══════════════════════════════════════════════════════════════════════
   MODAL
   ═══════════════════════════════════════════════════════════════════════ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(20,25,22,.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 999;
  align-items: center;
  justify-content: center;
  animation: overlayIn .2s var(--ease);
}
@keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }
.modal-overlay.open { display: flex; }

.modal {
  background: var(--surface);
  border-radius: var(--radius);
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: modalIn .25s var(--ease);
}
@keyframes modalIn { from { opacity: 0; transform: translateY(20px) scale(.97); } to { opacity: 1; transform: translateY(0) scale(1); } }

.modal-header {
  padding: 22px 26px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header h3 { font-size: 1.12rem; font-weight: 700; color: var(--text); }
.modal-close {
  cursor: pointer; font-size: 1.5rem;
  color: var(--text-muted);
  background: none; border: none; line-height: 1;
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.modal-close:hover { background: var(--bg); color: var(--text); }
.modal-body { padding: 22px 26px; }
.modal-footer {
  padding: 18px 26px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 10px;
  background: var(--surface-2);
}

/* ═══════════════════════════════════════════════════════════════════════
   FORMS
   ═══════════════════════════════════════════════════════════════════════ */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-2);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

input, select, textarea {
  width: 100%;
  padding: 10px 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-family: inherit;
  transition: all .18s var(--ease);
  background: var(--surface);
  color: var(--text);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(96,102,96,.12);
}
input::placeholder, textarea::placeholder { color: #a8b0a6; }
textarea { resize: vertical; min-height: 90px; }

/* ═══════════════════════════════════════════════════════════════════════
   TOOLBAR & FILTERS
   ═══════════════════════════════════════════════════════════════════════ */
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.toolbar input[type="text"] {
  max-width: 300px;
  padding: 9px 14px;
}

.filter-group { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-btn {
  padding: 7px 15px;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 600;
  font-family: inherit;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: all .18s var(--ease);
  color: var(--text-2);
}
.filter-btn:hover { border-color: var(--primary-l); color: var(--primary-d); }
.filter-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(96,102,96,.3);
}

/* ═══════════════════════════════════════════════════════════════════════
   QUICKBOOKS PANEL
   ═══════════════════════════════════════════════════════════════════════ */
.qb-status-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 22px 26px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.qb-status-info h3 { font-size: 1.08rem; font-weight: 700; margin-bottom: 5px; color: var(--text); }
.qb-status-info p  { font-size: .87rem; color: var(--text-muted); }

.qb-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 7px;
}
.qb-dot.connected {
  background: var(--success);
  box-shadow: 0 0 0 0 rgba(22,163,74,.5);
  animation: qbPulse 2s infinite;
}
@keyframes qbPulse {
  0% { box-shadow: 0 0 0 0 rgba(22,163,74,.5); }
  70% { box-shadow: 0 0 0 6px rgba(22,163,74,0); }
  100% { box-shadow: 0 0 0 0 rgba(22,163,74,0); }
}
.qb-dot.disconnected { background: var(--danger); }

/* ═══════════════════════════════════════════════════════════════════════
   ALERTS
   ═══════════════════════════════════════════════════════════════════════ */
.alert {
  padding: 13px 18px;
  border-radius: var(--radius-sm);
  font-size: .88rem;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid;
}
.alert-warning { background: #fffbeb; border-color: #fcd34d; color: #92400e; }
.alert-danger  { background: #fff1f2; border-color: #fecdd3; color: #9f1239; }
.alert-success { background: #f0fdf4; border-color: #86efac; color: #166534; }
.alert-info    { background: #eff6ff; border-color: #93c5fd; color: #1e40af; }

/* ═══════════════════════════════════════════════════════════════════════
   EMPTY STATE
   ═══════════════════════════════════════════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state .icon {
  font-size: 3.2rem;
  margin-bottom: 14px;
  opacity: .5;
}
.empty-state p { font-size: .92rem; }

/* ═══════════════════════════════════════════════════════════════════════
   PROGRESS BAR
   ═══════════════════════════════════════════════════════════════════════ */
.progress-bar {
  background: var(--border);
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
  margin-top: 8px;
}
.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--primary-l));
  transition: width .6s var(--ease);
}

/* ═══════════════════════════════════════════════════════════════════════
   SIDEBAR OVERLAY (mobile)
   ═══════════════════════════════════════════════════════════════════════ */
#sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(20,25,22,.55);
  backdrop-filter: blur(4px);
  z-index: 998;
}
#sidebar-overlay.open { display: block; }
#menu-btn { display: none; }

/* ═══════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  html, body { overflow-x: hidden; max-width: 100vw; }

  #sidebar {
    position: fixed;
    left: -280px;
    top: 0;
    width: 270px;
    height: 100vh;
    z-index: 999;
    transition: left .28s var(--ease);
  }
  #sidebar.open { left: 0; box-shadow: 0 24px 60px rgba(0,0,0,.45); }

  #menu-btn { display: inline-flex; }

  #main { width: 100vw; max-width: 100vw; overflow-x: hidden; }
  #topbar { padding: 12px 16px; }
  #topbar h1 { font-size: 1.05rem; }

  #page-content { padding: 14px; overflow-x: hidden; }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
  }
  .stat-card { padding: 14px 16px; }
  .stat-card .value { font-size: 1.55rem; }
  .stat-card .label { font-size: .66rem; }

  .form-row { grid-template-columns: 1fr; }

  .card {
    margin-bottom: 14px;
    width: 100%;
    max-width: calc(100vw - 24px);
    overflow-x: auto;
  }
  .card-header { flex-direction: column; align-items: flex-start; gap: 8px; }

  .table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; width: 100%; }
  table { min-width: 480px; font-size: .82rem; }
  td, thead th { padding: 10px 12px; }
  .hide-mobile { display: none; }

  .toolbar { flex-direction: column; align-items: stretch; gap: 8px; }
  .toolbar input[type="text"] { max-width: 100%; }
  .filter-group { flex-wrap: wrap; }

  .modal-overlay { align-items: flex-end; }
  .modal {
    max-width: 100%;
    width: 100%;
    border-radius: var(--radius) var(--radius) 0 0;
    max-height: 88vh;
  }

  .btn { font-size: .82rem; padding: 8px 13px; }
  .btn-sm { font-size: .76rem; padding: 6px 10px; }

  div[style*="grid-template-columns:1fr 1fr 1fr 1fr 1fr"] {
    display: flex !important;
    flex-direction: column !important;
  }
}

/* ═══════════════════════════════════════════════════════════════════════
   TOASTS
   ═══════════════════════════════════════════════════════════════════════ */
#toast-container {
  position: fixed;
  bottom: 26px;
  right: 26px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  background: var(--primary-dd);
  color: #fff;
  padding: 13px 20px;
  border-radius: var(--radius-sm);
  font-size: .87rem;
  box-shadow: var(--shadow-xl);
  animation: slideIn .28s var(--ease);
  max-width: 340px;
  font-weight: 500;
  border: 1px solid rgba(255,255,255,.06);
}
.toast.success { background: linear-gradient(135deg, #16a34a, #15803d); }
.toast.error   { background: linear-gradient(135deg, #dc2626, #b91c1c); }
.toast.warning { background: linear-gradient(135deg, var(--warning), #b45309); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ═══════════════════════════════════════════════════════════════════════
   UTILITIES
   ═══════════════════════════════════════════════════════════════════════ */
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); font-size: .82rem; }
.ml-auto    { margin-left: auto; }
.flex       { display: flex; }
.gap-2      { gap: 8px; }
.items-center { align-items: center; }

/* ═══════════════════════════════════════════════════════════════════════
   PLAN DES UNITÉS — Légende
   ═══════════════════════════════════════════════════════════════════════ */
.plan-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 12px 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  font-size: .82rem;
}
.plan-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}
.plan-legend-dot {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 4px;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════════════
   PLAN DES UNITÉS — Grille résidentielle
   ═══════════════════════════════════════════════════════════════════════ */
.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
}
.plan-tile {
  border-radius: 10px;
  padding: 10px 8px;
  cursor: pointer;
  transition: all .2s var(--ease);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-height: 92px;
  justify-content: space-between;
  user-select: none;
  border: 1px solid transparent;
}
.plan-tile:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.plan-tile-number  { font-size: 1.15rem; font-weight: 800; line-height: 1; font-family: 'Outfit'; }
.plan-tile-dim     { font-size: .7rem; font-weight: 600; opacity: .85; background: rgba(0,0,0,.1); padding: 1px 6px; border-radius: 4px; }
.plan-tile-tenant  { font-size: .7rem; line-height: 1.2; flex: 1; display: flex; align-items: center; justify-content: center; padding: 3px 0; }
.plan-tile-status  { font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; opacity: .8; }
.plan-detail-field { display: flex; flex-direction: column; gap: 2px; }
.plan-detail-label { font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }

/* ═══════════════════════════════════════════════════════════════════════
   PLAN DES UNITÉS — Building Plan
   ═══════════════════════════════════════════════════════════════════════ */
.bplan-building {
  display: flex; flex-direction: row; align-items: stretch;
  border: 3px solid #374151; border-radius: 4px;
  background: #f8fafc; width: fit-content; min-width: 600px;
}
.bplan-left-col {
  display: flex; flex-direction: column;
  border-right: 2px solid #374151; width: 60px; flex-shrink: 0;
}
.bplan-right-col {
  display: flex; flex-direction: column;
  border-left: 2px solid #374151; width: 60px; flex-shrink: 0;
}
.bplan-center { flex: 1; display: flex; flex-direction: row; }

.bplan-col-pair {
  width: 60px; flex-shrink: 0;
  display: flex; flex-direction: column; justify-content: space-between; align-items: stretch;
  height: 180px;
  background: #374151;
  border-right: 1px solid rgba(0,0,0,.2);
}
.bplan-col-pair:last-child { border-right: none; }

.bplan-row-tile {
  cursor: pointer;
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; text-align: center; padding: 4px 2px;
  border-right: 1px solid rgba(0,0,0,.18); gap: 2px;
  transition: filter .12s, transform .12s;
  position: relative; z-index: 1; user-select: none; flex-shrink: 0;
}
.bplan-row-tile:hover {
  filter: brightness(.85); z-index: 20;
  box-shadow: 0 4px 16px rgba(0,0,0,.25); transform: scale(1.05);
}

.bplan-col-tile {
  flex: 1; width: 100%; cursor: pointer;
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; text-align: center; padding: 2px;
  border-bottom: 1px solid rgba(0,0,0,.15);
  transition: filter .12s; position: relative; z-index: 1; user-select: none;
}
.bplan-col-tile:last-child { border-bottom: none; }
.bplan-col-tile:hover { filter: brightness(.85); z-index: 20; }

.bplan-col-spacer { flex: 1; background: #f1f5f9; min-height: 4px; }
.bplan-col-mec {
  flex: 1; background: #d1d5db;
  display: flex; align-items: center; justify-content: center;
  font-size: .45rem; font-weight: 700; text-transform: uppercase;
  color: #6b7280; text-align: center; line-height: 1.3; padding: 2px;
}
.bplan-missing {
  background: #f3f4f6 !important; border: 1px dashed #d1d5db !important;
  cursor: default; display: flex; align-items: center; justify-content: center;
  color: #9ca3af;
}
.bplan-missing:hover { filter: none !important; transform: none !important; box-shadow: none !important; }

.bplan-num    { font-size: .75rem; font-weight: 800; line-height: 1; font-family: 'Outfit'; }
.bplan-dim    { font-size: .58rem; font-weight: 700; background: rgba(0,0,0,.1); padding: 1px 3px; border-radius: 2px; }
.bplan-tenant { font-size: .58rem; line-height: 1.2; max-width: 90%; word-break: break-word; opacity: .85; }

@media (max-width: 768px) {
  .plan-legend { gap: 8px; font-size: .78rem; }
}

/* ═══════════════════════════════════════════════════════════════════════
   ACCESSIBILITY
   ═══════════════════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
