/* =========================================================
   locatif.org — app.css
   ========================================================= */

:root {
  --sidebar-width: 240px;
  --sidebar-bg: #1a1f2e;
  --sidebar-color: #c9d1d9;
  --sidebar-active-bg: #0d6efd;
  --sidebar-active-color: #fff;
  --sidebar-hover-bg: rgba(255,255,255,.07);
  --topbar-height: 56px;
  --brand-color: #0d6efd;
}

/* ── Layout ─────────────────────────────────────────────── */

#wrapper {
  display: flex;
  min-height: 100vh;
}

#sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--sidebar-bg);
  color: var(--sidebar-color);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  overflow-y: auto;
}

#main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

#topbar {
  height: var(--topbar-height);
  border-bottom: 1px solid var(--bs-border-color);
  position: sticky;
  top: 0;
  z-index: 99;
  background: var(--bs-body-bg);
}

#content {
  flex: 1;
  padding: 1.5rem;
}

/* ── Sidebar ─────────────────────────────────────────────── */

.sidebar-brand {
  padding: 1.25rem 1rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: .03em;
  text-decoration: none;
  display: block;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.sidebar-brand span {
  color: var(--brand-color);
}

.sidebar-section {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgba(255,255,255,.35);
  padding: 1.25rem 1rem .35rem;
}

.sidebar-nav .nav-link {
  color: var(--sidebar-color);
  padding: .5rem 1rem;
  border-radius: .375rem;
  margin: .1rem .5rem;
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: .9rem;
  transition: background .15s;
  text-decoration: none;
}

.sidebar-nav .nav-link:hover {
  background: var(--sidebar-hover-bg);
  color: #fff;
}

.sidebar-nav .nav-link.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active-color);
}

.sidebar-nav .nav-link i {
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}

/* ── Badges statuts ──────────────────────────────────────── */

.badge-disponible   { background: #198754 !important; }
.badge-loue         { background: #0d6efd !important; }
.badge-en_renovation{ background: #fd7e14 !important; }
.badge-inactif      { background: #6c757d !important; }

.badge-actif        { background: #198754 !important; }
.badge-termine      { background: #6c757d !important; }
.badge-resilie      { background: #dc3545 !important; }
.badge-en_attente   { background: #ffc107 !important; color: #000 !important; }

.badge-paye         { background: #198754 !important; }
.badge-partiel      { background: #fd7e14 !important; }
.badge-annule       { background: #dc3545 !important; }

.badge-ouverte      { background: #0dcaf0 !important; color: #000 !important; }
.badge-en_cours     { background: #0d6efd !important; }
.badge-resolue      { background: #198754 !important; }
.badge-fermee       { background: #6c757d !important; }

.badge-basse        { background: #198754 !important; }
.badge-normale      { background: #0d6efd !important; }
.badge-haute        { background: #fd7e14 !important; }
.badge-urgente      { background: #dc3545 !important; }

.badge-planifiee    { background: #0d6efd !important; }
.badge-completee    { background: #198754 !important; }
.badge-annulee      { background: #6c757d !important; }
.badge-no_show      { background: #dc3545 !important; }

/* ── KPI Cards ───────────────────────────────────────────── */

.kpi-card {
  border-radius: .75rem;
  border: 1px solid var(--bs-border-color);
}

.kpi-card .kpi-value {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
}

.kpi-card .kpi-label {
  font-size: .8rem;
  opacity: .7;
  text-transform: uppercase;
  letter-spacing: .05em;
}

/* ── Tables ──────────────────────────────────────────────── */

.table th {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  opacity: .6;
  font-weight: 600;
}

/* ── HTMX loading indicator ─────────────────────────────── */

.htmx-indicator {
  opacity: 0;
  transition: opacity 200ms ease-in;
}
.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
  opacity: 1;
}

/* ── Dark mode tweaks ────────────────────────────────────── */

[data-bs-theme="dark"] #topbar {
  background: #212529;
}
