/* ============================================================
   LAYOUT — sidebar, topbar, nav, brand, main, footer
   Portail client + admin uniquement (pas les pages auth)
   ============================================================ */

/* Shell principal */
.app-layout,
.app {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px 16px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(7,17,32,.96), rgba(6,14,27,.90));
  backdrop-filter: blur(14px);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ── Brand ── */
.brand,
.brand-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px 18px;
  border-bottom: 1px solid var(--line);
}

.brand-logo {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  object-fit: contain;
  background: rgba(255,255,255,.04);
  padding: 6px;
  flex-shrink: 0;
}

.brand-name {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
}

.brand-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

/* ── User card ── */
.user-card {
  background: linear-gradient(180deg, var(--s1), var(--s2));
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 14px 16px;
  backdrop-filter: blur(10px);
}

.user-name  { font-weight: 700; font-size: 17px; margin-bottom: 3px; }
.user-email,
.user-mail  { font-size: 13px; color: var(--muted); word-break: break-word; }

/* ── Nav ── */
.nav-card {
  background: linear-gradient(180deg, var(--s1), var(--s2));
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 14px 16px;
  backdrop-filter: blur(10px);
}

.nav-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--muted);
  margin-bottom: 10px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  border-radius: 14px;
  color: #dce8ff;
  border: 1px solid transparent;
  transition: background .18s ease, border-color .18s ease;
  margin-bottom: 4px;
  font-size: 14px;
}

.nav-link:last-child { margin-bottom: 0; }

.nav-link:hover,
.nav-link.active {
  background: linear-gradient(180deg, rgba(98,168,255,.18), rgba(98,168,255,.08));
  border-color: rgba(98,168,255,.28);
}

/* ── Main area ── */
.main {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 24px 0;
  flex-wrap: wrap;
}

.page-title {
  margin: 0 0 4px;
  font-size: 28px;
  font-weight: 800;
}

.page-sub {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.page-content {
  padding: 22px 24px;
  flex: 1;
}

/* ── Footer ── */
.site-footer {
  margin-top: auto;
  padding: 18px 24px 28px;
  text-align: center;
  font-size: 13px;
  color: rgba(240,245,255,.55);
}

/* ── Topbar (barre en haut du main) ── */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.topbar-left h1 { margin: 0; font-size: 28px; }
.topbar-left p  { margin: 5px 0 0; color: var(--muted); font-size: 14px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ── Responsive ── */
@media (max-width: 1100px) {
  .app-layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: relative;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 760px) {
  .page-header,
  .page-content { padding-left: 16px; padding-right: 16px; }
  .page-title { font-size: 22px; }
  .topbar-left h1 { font-size: 22px; }
}

/* ── Topbar inner (compatibilité anciennes pages) ── */
.topbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  width: 100%;
  flex-wrap: wrap;
}
.site-logo { width: 40px; height: 40px; object-fit: contain; }
.actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
