/* ─── App shell ─────────────────────────────────────────────────────────── */
.app-layout{display:flex;align-items:stretch;min-height:100vh;background:#f0f2f5}

/* ─── Sidebar ────────────────────────────────────────────────────────────── */
.sidebar{
  width:220px;max-width:220px;min-height:100vh;
  background:linear-gradient(180deg,#0b1e33 0%,#0f2a42 60%,#091828 100%);
  color:#fff;display:flex;flex-direction:column;flex-shrink:0;
  border-right:1px solid rgba(255,255,255,.05);
  position:sticky;top:0;height:100vh;z-index:30;overflow:hidden;
}
.sidebar-header{padding:20px 18px 15px;border-bottom:1px solid rgba(255,255,255,.08);flex-shrink:0}
.logo{font-size:18px;font-weight:800;letter-spacing:.06em;color:#fff}
.sidebar-subtitle{margin-top:4px;color:rgba(255,255,255,.45);font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.08em}

/* ─── Nav ────────────────────────────────────────────────────────────────── */
.sidebar-nav{flex:1;padding:12px 10px;overflow-y:auto;overflow-x:hidden}
.nav-section-label{padding:0 8px;margin:14px 0 5px;font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.1em;color:rgba(255,255,255,.28)}
.nav-section-label:first-child{margin-top:2px}
.nav-item,.nav-item-button{
  width:100%;display:flex;align-items:center;gap:10px;margin-bottom:2px;
  padding:9px 10px;border-radius:10px;color:rgba(210,228,245,.72);
  text-decoration:none;transition:background .15s,color .15s;
  border:none;font-weight:600;font-size:13px;background:transparent;
  cursor:pointer;line-height:1.3;text-align:left;box-sizing:border-box;
}
.nav-item:hover,.nav-item-button:hover{background:rgba(255,255,255,.08);color:#fff}
.nav-item.is-active,.nav-item.active{background:rgba(47,119,170,.38);color:#fff;box-shadow:inset 0 0 0 1px rgba(47,119,170,.38)}
.nav-icon{
  width:28px;height:28px;border-radius:7px;
  display:inline-flex;align-items:center;justify-content:center;
  background:rgba(255,255,255,.07);font-size:13px;flex-shrink:0;transition:background .15s;
}
.nav-item:hover .nav-icon,.nav-item-button:hover .nav-icon{background:rgba(255,255,255,.12)}
.nav-item.is-active .nav-icon,.nav-item.active .nav-icon{background:rgba(47,119,170,.5)}
.nav-badge{
  margin-left:auto;min-width:18px;height:18px;padding:0 5px;
  border-radius:999px;background:#2f77aa;color:#fff;
  font-size:10px;font-weight:800;display:inline-flex;align-items:center;justify-content:center;
}

/* ─── Sidebar logo ──────────────────────────────────────────────────────── */
.sidebar-logo-wrap {
  padding: 12px 10px 10px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  flex-shrink: 0;
  overflow: hidden;
  background: transparent;
}
.sidebar-logo-wrap a { display: block; line-height: 0 }
.sidebar-logo-img {
  width: 100%;
  max-height: 80px;
  object-fit: contain;
  object-position: center left;
}

/* ─── Topbar nav buttons (Accueil / Retour) ──────────────────────────────── */
.topbar-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #334155;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all .15s;
  white-space: nowrap;
}
.topbar-nav-btn:hover { background: #e2e8f0; border-color: #cbd5e1; color: #0b1e33 }
.topbar-nav-btn svg   { flex-shrink: 0 }
.topbar-back-btn      { background: #fff }

@media (max-width: 640px) {
  .topbar-nav-label { display: none }
  .topbar-nav-btn   { padding: 0 8px }
}

/* ─── Sidebar footer ─────────────────────────────────────────────────────── */
.sidebar-footer{padding:10px;border-top:1px solid rgba(255,255,255,.07);flex-shrink:0}
.sidebar-footer-note{padding:8px 10px;border-radius:8px;background:rgba(255,255,255,.04);color:rgba(255,255,255,.35);font-size:11px;font-weight:600;margin-bottom:4px}
.sidebar-footer form button{
  display:flex;align-items:center;gap:10px;width:100%;background:transparent;border:0;
  color:rgba(210,228,245,.55);font-weight:600;font-size:13px;padding:9px 10px;
  border-radius:10px;cursor:pointer;transition:background .15s,color .15s;
}
.sidebar-footer form button:hover{background:rgba(255,255,255,.07);color:#fff}

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

/* ─── Topbar ─────────────────────────────────────────────────────────────── */
.topbar{
  height:58px;min-height:58px;background:#fff;border-bottom:1px solid #e5eaf1;
  display:flex;align-items:center;justify-content:space-between;
  padding:0 24px;position:sticky;top:0;z-index:20;flex-shrink:0;
}
.topbar-left,.topbar-right{display:flex;align-items:center;gap:12px}
.topbar-app-icon{display:none}
.topbar-breadcrumb{font-size:14px;font-weight:700;color:#334155}
.topbar-breadcrumb span{color:#94a3b8;font-weight:500}
.topbar-search-wrap{
  height:36px;border-radius:10px;border:1px solid #e2e8f0;background:#f8fafc;
  padding:0 12px;display:flex;align-items:center;gap:8px;min-width:190px;
}
.topbar-search-icon{font-size:14px;color:#94a3b8}
.topbar-search{min-width:0;width:100%;height:100%;border:0;background:transparent;color:#334155;font-size:13px;outline:none}
.topbar-avatar{
  display:inline-flex;align-items:center;justify-content:center;
  width:34px;height:34px;border-radius:999px;
  background:#0f2238;color:#fff;font-size:13px;font-weight:800;cursor:default;
}
.topbar-username{font-size:13px;font-weight:600;color:#475569}
.menu-toggle{
  display:none;width:36px;height:36px;border-radius:9px;
  background:#f1f5f9;border:1px solid #e2e8f0;font-size:16px;
  cursor:pointer;color:#0f172a;align-items:center;justify-content:center;
}

/* ─── Content area ───────────────────────────────────────────────────────── */
.content-area{flex:1;padding:22px 24px 28px}
.content-shell{width:100%}

/* ─── Mobile overlay ─────────────────────────────────────────────────────── */
.sidebar-overlay{display:none;position:fixed;inset:0;background:rgba(0,0,0,.45);z-index:29}
.sidebar-overlay.active{display:block}

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width:980px){
  .sidebar{
    position:fixed;inset:0 auto 0 0;
    transform:translateX(-105%);transition:transform .22s ease;
    width:240px;max-width:240px;box-shadow:4px 0 30px rgba(0,0,0,.3);
  }
  .sidebar.open{transform:translateX(0)}
  .menu-toggle{display:inline-flex}
  .topbar{padding:0 16px;height:52px;min-height:52px}
  .content-area{padding:16px 16px 22px}
  .topbar-search-wrap{min-width:0;width:150px}
}
@media (max-width:640px){
  .topbar-search-wrap{display:none}
  .topbar-username{display:none}
  .content-area{padding:14px 12px 20px}
}
