/* ============================================================
   LAYOUT.CSS — Sidebar, Topbar, structure principale
   GP-MFB · Gestionnaire du Patrimoine
   ============================================================ */

/* ══════════════════════════════════════
   SIDEBAR
══════════════════════════════════════ */
.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--blue-dark);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

/* Logo + nom appli */
.sb-logo {
  padding: 1.6rem 1.4rem 1.2rem;
  border-bottom: 0.5px solid #1E3356;
  display: flex;
  align-items: center;
  gap: 11px;
  flex-shrink: 0;
}
.sb-logo svg { flex-shrink: 0; }

.sb-brand {
  color: #B8CCDF;
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  line-height: 1.5;
  font-weight: 500;
}
.sb-brand strong {
  display: block;
  color: #EEF4FF;
  font-size: 11px;
}

/* Titre de section */
.sb-section {
  padding: .8rem 1.2rem .3rem;
  font-size: 10px;
  color: #3D5A78;
  letter-spacing: .1em;
  text-transform: uppercase;
  font-weight: 500;
  flex-shrink: 0;
}

/* Nav items */
.sb-nav {
  list-style: none;
  padding: 0 .6rem;
  flex-shrink: 0;
}
.sb-nav li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: .55rem .8rem;
  border-radius: 8px;
  font-size: 13px;
  color: #6A8FAD;
  transition: background .15s, color .15s;
}
.sb-nav li a:hover {
  background: #1A3154;
  color: #C8D8E8;
  text-decoration: none;
}
.sb-nav li a.active {
  background: var(--blue-act);
  color: #EEF4FF;
  font-weight: 500;
}
.sb-nav li a .ico {
  width: 16px;
  height: 16px;
  opacity: .7;
  flex-shrink: 0;
}
.sb-nav li a.active .ico,
.sb-nav li a:hover .ico { opacity: 1; }

/* Badge compteur nav */
.sb-badge {
  margin-left: auto;
  background: var(--orange);
  color: #fff;
  font-size: 10px;
  font-weight: 500;
  padding: 1px 6px;
  border-radius: 10px;
}

/* Bas de sidebar (profil + déconnexion) */
.sb-bottom {
  margin-top: auto;
  padding: 1rem 1.2rem;
  border-top: 0.5px solid #1E3356;
  flex-shrink: 0;
}
.sb-user {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sb-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--blue-act);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 500;
  color: #B8D0F0;
  flex-shrink: 0;
}
.sb-uname {
  font-size: 12px;
  color: #8AAAC3;
  line-height: 1.4;
  min-width: 0;
  overflow: hidden;
}
.sb-uname strong {
  display: block;
  color: #C8D8E8;
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sb-logout {
  margin-left: auto;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: none;
  border: 0.5px solid #1E3356;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #4D6A8A;
  flex-shrink: 0;
  transition: background .15s, color .15s;
}
.sb-logout:hover {
  background: #1A3154;
  color: #8AAAC3;
}

/* ══════════════════════════════════════
   MAIN WRAPPER
══════════════════════════════════════ */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
}

/* ══════════════════════════════════════
   TOPBAR
══════════════════════════════════════ */
.topbar {
  background: var(--white);
  border-bottom: 0.5px solid var(--border);
  padding: .9rem 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
  flex-shrink: 0;
}
.topbar-title {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}
.topbar-date {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

/* Barre de recherche */
.topbar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 0.5px solid var(--border);
  border-radius: 8px;
  padding: 0 12px;
  height: 36px;
}
.topbar-search input {
  background: none;
  border: none;
  outline: none;
  font-size: 13px;
  color: var(--text);
  width: 180px;
}
.topbar-search input::placeholder { color: var(--hint); }

/* Bouton notifications */
.topbar-notif {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 0.5px solid var(--border);
  background: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  position: relative;
  transition: background .15s;
  flex-shrink: 0;
}
.topbar-notif:hover { background: var(--bg); }
.notif-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--orange);
  border: 1.5px solid var(--white);
}

/* ══════════════════════════════════════
   ZONE CONTENU
══════════════════════════════════════ */
.content {
  padding: 2rem;
  flex: 1;
}

/* ══════════════════════════════════════
   GRILLES DE MISE EN PAGE
══════════════════════════════════════ */
.grid-kpi {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}
.grid-main {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.flex-col {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* ══════════════════════════════════════
   AUTH LAYOUT (page connexion)
══════════════════════════════════════ */
.auth-card {
  display: flex;
  width: 100%;
  max-width: 840px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(9,27,53,.18), 0 4px 16px rgba(9,27,53,.08);
  min-height: 500px;
}

/* Panneau gauche bleu */
.auth-left {
  width: 42%;
  background: var(--blue-dark);
  padding: 2.8rem 2.2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.auth-deco {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
}
.auth-badge {
  display: flex;
  align-items: center;
  gap: 13px;
  position: relative;
  z-index: 1;
}
.auth-org {
  color: #B8CCDF;
  font-size: 10.5px;
  letter-spacing: .07em;
  line-height: 1.55;
  text-transform: uppercase;
  font-weight: 500;
}
.auth-tagline {
  position: relative;
  z-index: 1;
}
.auth-tagline h2 {
  font-family: var(--font-serif);
  color: #F0F6FF;
  font-size: 26px;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 10px;
}
.auth-tagline p {
  color: #6A8FAD;
  font-size: 12px;
  line-height: 1.75;
}
.auth-footer {
  position: relative;
  z-index: 1;
  border-top: 0.5px solid #1E3356;
  padding-top: 16px;
}
.auth-footer p {
  color: #3D5A78;
  font-size: 10.5px;
  line-height: 1.6;
}

/* Panneau droit */
.auth-right {
  flex: 1;
  background: var(--white);
  padding: 3rem 2.8rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.auth-right h1 {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.auth-sub {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 26px;
}
.auth-divider {
  width: 34px;
  height: 2px;
  background: var(--gold);
  border-radius: 2px;
  margin-bottom: 24px;
}
.auth-help {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  margin-top: 18px;
}
.auth-help a {
  color: var(--blue-act);
  font-weight: 500;
}
.auth-help a:hover { text-decoration: underline; }

/* ══════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════ */
@media (max-width: 1100px) {
  .grid-kpi  { grid-template-columns: repeat(2, 1fr); }
  .grid-main { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .sidebar { display: none; }
  .content { padding: 1rem; }
  .grid-kpi { grid-template-columns: 1fr 1fr; }
  .grid-3   { grid-template-columns: 1fr; }
  .auth-card { flex-direction: column; }
  .auth-left { width: 100%; }
  .auth-tagline { display: none; }
  .auth-right { padding: 2rem 1.5rem; }
}
@media (max-width: 480px) {
  .grid-kpi { grid-template-columns: 1fr; }
}
