/*
 * layout.css — BEYENI
 * Structures de mise en page : site, dashboard, listing, auth.
 * ⚠️ Toujours via var(--byn-*) — jamais de couleurs hardcodées.
 */

/* ─────────────────────────────────────────────────────────────────────
   SITE — Corps général
───────────────────────────────────────────────────────────────────── */
.byn-site {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.byn-site-main {
  flex: 1;
}

/* Corps de page standard (hors dashboard) */
.byn-page {
  padding-top: 3rem;
  padding-bottom: 4rem;
}

.byn-page--full {
  padding-top: 0;
  padding-bottom: 0;
}

/* ─────────────────────────────────────────────────────────────────────
   DASHBOARD — Structure sidebar + contenu
───────────────────────────────────────────────────────────────────── */
.byn-dash {
  display: grid;
  grid-template-columns: var(--byn-dash-nav-w) 1fr;
  min-height: 100vh;
  /* Pas de header site dans le dashboard */
}

/* ── Navigation latérale ─────────────────────────────────────────── */
.byn-dash-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--byn-dash-nav-w);
  height: 100vh;
  background: var(--byn-dark);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 50;
  transition: transform 0.3s ease, width 0.3s ease;
}

.byn-dash-nav__logo {
  padding: 1.5rem 1.25rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.byn-dash-nav__logo a { text-decoration: none; }
.byn-dash-nav__logo img { height: 32px; }
.byn-dash-nav__logo-text {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--byn-primary-3);
  letter-spacing: -0.02em;
}

.byn-dash-nav__user {
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid rgba(255,255,255,.07);
}

.byn-dash-nav__user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--byn-primary);
  color: var(--byn-white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  font-weight: 700;
  flex-shrink: 0;
}

.byn-dash-nav__user-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.byn-dash-nav__user-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--byn-white);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.byn-dash-nav__notif-btn {
  position: relative;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,.5);
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--byn-transition), color var(--byn-transition);
}
.byn-dash-nav__notif-btn:hover {
  background: rgba(255,255,255,.07);
  color: var(--byn-white);
}

.byn-dash-nav__notif-count {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  background: var(--byn-danger);
  color: var(--byn-white);
  font-size: 0.625rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-inline: 3px;
}

/* ── Liens nav ───────────────────────────────────────────────────── */
.byn-dash-nav__links {
  flex: 1;
  padding: 0.75rem 0.75rem;
  overflow-y: auto;
}

.byn-dash-nav__links ul {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.byn-dash-nav__item--logout {
  margin-top: auto;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255,255,255,.07);
}

.byn-dash-nav__link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.875rem;
  border-radius: 10px;
  color: rgba(255,255,255,.6);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  transition: background var(--byn-transition), color var(--byn-transition);
}
.byn-dash-nav__link:hover {
  background: rgba(255,255,255,.06);
  color: var(--byn-white);
}
.byn-dash-nav__item.is-active .byn-dash-nav__link {
  background: var(--byn-primary);
  color: var(--byn-white);
}
.byn-dash-nav__item--logout .byn-dash-nav__link:hover {
  background: rgba(239,68,68,.15);
  color: var(--byn-danger);
}

.byn-dash-nav__link-icon {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  opacity: 0.8;
}
.byn-dash-nav__item.is-active .byn-dash-nav__link-icon { opacity: 1; }

/* ── Bouton réduire ──────────────────────────────────────────────── */
.byn-dash-nav__toggle {
  padding: 1rem 1.25rem;
  color: rgba(255,255,255,.3);
  display: flex;
  align-items: center;
  cursor: pointer;
  transition: color var(--byn-transition);
  border-top: 1px solid rgba(255,255,255,.07);
}
.byn-dash-nav__toggle:hover { color: var(--byn-white); }

/* ── Contenu dashboard ───────────────────────────────────────────── */
.byn-dash-content {
  grid-column: 2;
  padding: 2rem 2.5rem;
  background: var(--byn-bg-soft);
  min-height: 100vh;
}

.byn-dash-content__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.byn-dash-content__title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--byn-dark);
}

/* ── Panneau notifications ───────────────────────────────────────── */
.byn-notif-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 340px;
  height: 100vh;
  background: var(--byn-white);
  border-left: 1px solid var(--byn-border);
  z-index: 200;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  box-shadow: var(--byn-shadow-lg);
}
.byn-notif-panel.is-open { transform: translateX(0); }

.byn-notif-panel__header {
  padding: 1.25rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--byn-border);
  font-weight: 600;
}
.byn-notif-panel__close {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--byn-gray);
  transition: background var(--byn-transition);
}
.byn-notif-panel__close:hover { background: var(--byn-bg-soft); }

.byn-notif-panel__list {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
}
.byn-notif-panel__empty {
  text-align: center;
  color: var(--byn-gray);
  padding: 2rem 1rem;
  font-size: 0.9375rem;
}

/* ─────────────────────────────────────────────────────────────────────
   KPI CARDS (dashboard)
───────────────────────────────────────────────────────────────────── */
.byn-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.byn-kpi-card {
  background: var(--byn-white);
  border: 1px solid var(--byn-border);
  border-radius: var(--byn-radius-lg);
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.byn-kpi-card__value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--byn-primary);
  line-height: 1;
}

.byn-kpi-card__label {
  font-size: 0.8125rem;
  color: var(--byn-gray);
  font-weight: 500;
}

.byn-kpi-card__trend {
  font-size: 0.8125rem;
  font-weight: 600;
}
.byn-kpi-card__trend--up   { color: var(--byn-success); }
.byn-kpi-card__trend--down { color: var(--byn-danger); }

/* ─────────────────────────────────────────────────────────────────────
   LISTING GRID
───────────────────────────────────────────────────────────────────── */
.byn-listing {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
  align-items: start;
}

.byn-listing__filters {
  position: sticky;
  top: calc(var(--byn-header-h) + 1rem);
}

.byn-listing__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.byn-listing__grid--list {
  grid-template-columns: 1fr;
}

/* ─────────────────────────────────────────────────────────────────────
   AUTH PAGE
───────────────────────────────────────────────────────────────────── */
.byn-auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.byn-auth__visual {
  background: linear-gradient(135deg, var(--byn-primary-dark) 0%, var(--byn-primary) 60%, var(--byn-primary-2) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  color: var(--byn-white);
}

.byn-auth__visual-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--byn-white);
  text-align: center;
  margin-bottom: 0.75rem;
}

.byn-auth__visual-sub {
  color: rgba(255,255,255,.75);
  text-align: center;
  font-size: 1.0625rem;
}

.byn-auth__form-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 4rem;
  background: var(--byn-white);
}

.byn-auth__form-box {
  width: 100%;
  max-width: 440px;
}

.byn-auth__form-title {
  font-size: 1.75rem;
  margin-bottom: 0.375rem;
}

.byn-auth__form-sub {
  color: var(--byn-gray);
  margin-bottom: 2rem;
}

.byn-auth__form-footer {
  margin-top: 1.25rem;
  text-align: center;
  font-size: 0.9375rem;
  color: var(--byn-gray);
}