/* =========================================================
   layout.css — structure commune : menu latéral, barre haute, contenu
   ========================================================= */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 60;
  background: var(--sidebar-bg); color: var(--sidebar-text);
  display: flex; flex-direction: column; overflow-y: auto;
  transition: transform .22s ease, width .22s ease;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 16px 18px; color: #fff; border-bottom: 1px solid rgba(255,255,255,.07); }
.brand:hover { text-decoration: none; }
.brand-logo { width: 36px; height: 36px; border-radius: 9px; background: linear-gradient(135deg, #3b82f6, #1d5fd1); display: grid; place-items: center; flex-shrink: 0; }
.brand-logo .ic { width: 20px; height: 20px; color: #fff; }
.brand-name { display: block; font-weight: 700; font-size: 15px; line-height: 1.2; }
.brand-sub { display: block; font-size: 11.5px; color: #8796ad; }

.nav { padding: 8px 10px; flex: 1; }
.nav-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: #6b7a92; padding: 14px 10px 6px; font-weight: 600; }
.nav-link {
  display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 7px;
  color: var(--sidebar-text); font-weight: 500; font-size: 13.5px; white-space: nowrap; position: relative;
}
.nav-link .ic { color: #8291a8; }
.nav-link:hover { background: var(--sidebar-hover); color: #fff; text-decoration: none; }
.nav-link:hover .ic { color: #c9d3e3; }
.nav-link.active { background: var(--sidebar-active); color: var(--sidebar-active-text); }
.nav-link.active .ic { color: #7fb0ff; }
.nav-link.active::before { content: ""; position: absolute; left: -10px; top: 7px; bottom: 7px; width: 3px; border-radius: 0 3px 3px 0; background: #4d8cff; }
.sidebar-foot { padding: 10px; border-top: 1px solid rgba(255,255,255,.07); }
.sidebar-overlay { display: none; }

.main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; transition: margin-left .22s ease; }

.topbar {
  position: sticky; top: 0; z-index: 50; height: var(--topbar-h);
  background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 20px;
}
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 10px; min-width: 0; }
.agency { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.agency strong { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agency-sub { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.demo-date { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.demo-date .ic { width: 14px; height: 14px; }
.pill-demo { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--warning); background: var(--warning-bg); border: 1px solid #f3d3a4; padding: 3px 8px; border-radius: 999px; }
.vsep { width: 1px; height: 26px; background: var(--border); }
.user { display: flex; align-items: center; gap: 9px; border: 0; background: none; padding: 4px 6px; border-radius: 8px; text-align: left; }
.user:hover { background: var(--surface-2); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--primary-light); color: var(--primary); display: grid; place-items: center; font-weight: 700; font-size: 12.5px; flex-shrink: 0; }
.user-info { display: flex; flex-direction: column; line-height: 1.2; }
.user-name { font-weight: 600; font-size: 13px; white-space: nowrap; }
.user-role { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.has-dot { position: relative; }
.dot-count { position: absolute; top: 2px; right: 1px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--surface); }

.notif { display: flex !important; gap: 10px; align-items: flex-start !important; white-space: normal !important; }
.notif strong { display: block; font-size: 13px; color: var(--text); }
.notif-sub { display: block; font-size: 12px; color: var(--muted); }
.notif-ic { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex-shrink: 0; }
.notif-ic .ic { width: 16px; height: 16px; margin: 0 !important; }
.notif-ic.danger { background: var(--danger-bg); color: var(--danger); }
.notif-ic.warning { background: var(--warning-bg); color: var(--warning); }

.breadcrumb { display: flex; align-items: center; gap: 6px; padding: 12px 24px 0; font-size: 12.5px; color: var(--muted); }
.breadcrumb .ic { width: 13px; height: 13px; color: var(--subtle); }
.breadcrumb a { color: var(--muted); }
.breadcrumb .current { color: var(--text); font-weight: 500; }

.content { padding: 14px 24px 24px; flex: 1; width: 100%; max-width: 1480px; }
.page-foot { margin-top: 28px; padding-top: 14px; border-top: 1px dashed var(--border); font-size: 12px; color: var(--subtle); }

/* En-tête de page */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head p { color: var(--muted); margin-top: 4px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Menu replié (bureau) */
body.sidebar-collapsed .sidebar { width: 68px; }
body.sidebar-collapsed .main { margin-left: 68px; }
body.sidebar-collapsed .brand > span:last-child,
body.sidebar-collapsed .nav-label { display: none; }
body.sidebar-collapsed .nav-link { font-size: 0; justify-content: center; padding: 10px; }
body.sidebar-collapsed .nav-link .ic { width: 20px; height: 20px; }
body.sidebar-collapsed .brand { justify-content: center; padding: 16px 0; }

body.modal-open { overflow: hidden; }
