/* Coque de l'application : barre latérale (projets + conversations), en-tête, zone de contenu. */

.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); height: 100dvh; overflow: hidden; }

/* — Barre latérale — */
.sidebar {
  display: flex; flex-direction: column; min-height: 0;
  background: var(--surface); border-right: 1px solid var(--border);
  padding: 0 10px; overflow: hidden;
}
.brand { display: flex; align-items: center; gap: 10px; height: 58px; padding: 0 8px; flex: none; }
.brand__mark {
  width: 30px; height: 30px; border-radius: 9px; flex: none; display: grid; place-items: center;
  background: radial-gradient(120% 120% at 20% 10%, #2C4270 0%, var(--logo-bg) 55%, var(--orb-deep) 100%);
  color: var(--mint); font-weight: 700; font-size: 15px; letter-spacing: .02em;
  box-shadow: inset 0 0 0 1px #FFFFFF14;
}
.brand__name { font-weight: 600; font-size: 15px; letter-spacing: -.01em; }
.brand__name span { color: var(--accent); }
.brand__tag { font-size: 11px; line-height: 14px; color: var(--ink-muted); letter-spacing: .06em; text-transform: uppercase; }

.org {
  display: flex; align-items: center; gap: 10px; width: 100%;
  margin: 0 0 10px; padding: 9px 10px; text-align: left;
  border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg);
}
.org__avatar {
  width: 28px; height: 28px; border-radius: 8px; flex: none; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: 13px;
}
.org__name { font-size: 13.5px; font-weight: 600; line-height: 18px; }
.org__role { font-size: 11px; line-height: 15px; color: var(--ink-muted); text-transform: capitalize; }

.side-actions { display: flex; flex-direction: column; gap: 6px; flex: none; }
.side-action {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 38px;
  padding: 0 10px; border-radius: 9px; font-size: 13.5px; font-weight: 500;
  color: var(--ink); text-align: left;
}
.side-action:hover { background: var(--surface-hover); }
.side-action svg { width: 17px; height: 17px; flex: none; color: var(--ink-muted); }
.side-action--primary { border: 1px solid var(--control-border); background: var(--bg); }
.side-action--primary:hover { background: var(--bg); border-color: var(--accent); color: var(--accent); }
.side-action--primary:hover svg { color: var(--accent); }

.side-scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding-top: 14px; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.side-list .row { min-width: 0; }
.side-list .row > .side-item { flex: 1 1 auto; width: auto; min-width: 0; }
.side-group { margin-bottom: 18px; }
.side-group__head {
  display: flex; align-items: center; gap: 8px; padding: 0 10px 6px;
  font-size: 11px; line-height: 16px; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: var(--ink-muted);
}
.side-group__head .count { margin-left: auto; font-weight: 500; letter-spacing: 0; }
.side-list { display: flex; flex-direction: column; gap: 1px; }
.side-item {
  display: flex; align-items: center; gap: 9px; width: 100%; min-height: 34px;
  padding: 0 10px; border-radius: 8px; font-size: 13.5px;
  color: var(--ink); text-align: left; text-decoration: none;
}
.side-item:hover { background: var(--surface-hover); }
.side-item[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 500; }
.side-item svg { width: 16px; height: 16px; flex: none; opacity: .8; }
.side-item__label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-item__meta { font-size: 11px; color: var(--ink-muted); flex: none; }
.side-item__del {
  width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center;
  color: var(--ink-muted); opacity: 0; flex: none;
}
.side-item:hover .side-item__del, .side-item__del:focus-visible { opacity: 1; }
.side-item__del:hover { background: var(--danger-soft); color: var(--danger); }
.side-empty { padding: 4px 10px 8px; font-size: 12.5px; color: var(--ink-muted); }

.side-foot { flex: none; border-top: 1px solid var(--border); padding: 8px 0 10px; }
.side-user { display: flex; align-items: center; gap: 9px; padding: 4px 8px 8px; }
.side-user__mail { font-size: 12px; line-height: 16px; color: var(--ink-muted); }
.side-user__name { font-size: 13px; line-height: 18px; font-weight: 500; }

/* — Colonne principale — */
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg); }
.topbar {
  display: flex; align-items: center; gap: 12px; flex: none;
  height: 58px; padding: 0 20px; border-bottom: 1px solid var(--border);
}
.topbar h1 { font-size: 15px; line-height: 22px; font-weight: 600; }
.topbar__ctx { font-size: 12px; color: var(--ink-muted); }
.spacer { flex: 1; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 9px; display: inline-flex;
  align-items: center; justify-content: center; color: var(--ink-muted);
}
.icon-btn:hover { background: var(--surface-hover); color: var(--ink); }
.icon-btn svg { width: 18px; height: 18px; }
.nav-toggle { display: none; }

.view { flex: 1; min-height: 0; overflow-y: auto; }
.view--flush { overflow: hidden; display: flex; flex-direction: column; }
.page { width: 100%; max-width: 1040px; margin: 0 auto; padding: 26px 24px 40px; }
.page__head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 22px; }
.page__head h1 { font-size: 22px; line-height: 30px; }
.page__head p { color: var(--ink-muted); margin-top: 4px; font-size: 13.5px; }

/* — Tiroir mobile — */
.scrim { display: none; }
@media (max-width: 1024px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: 282px; z-index: 70;
    transform: translateX(-100%); transition: transform .2s cubic-bezier(.16, 1, .3, 1);
    box-shadow: var(--shadow-dialog);
  }
  .sidebar.is-open { transform: none; }
  .nav-toggle { display: inline-flex; }
  .scrim.is-on {
    display: block; position: fixed; inset: 0; z-index: 65; background: var(--scrim);
  }
  .page { padding: 20px 16px 32px; }
  .topbar { padding: 0 12px; }
}
