/* WIS CRM — barre latérale rail + panneau */
.sidebar.wis-sb {
  --rail-w: 62px; --panel-w: 236px;
  width: calc(var(--rail-w) + var(--panel-w));
  padding: 0; display: flex; flex-direction: row; overflow: hidden;
  background: #0b0d12; border-right: 1px solid rgba(255,255,255,.05);
}
.wis-legacy { display: none !important; }

/* ---------------- Rail */
.wis-rail {
  width: var(--rail-w); flex: 0 0 var(--rail-w); display: flex; flex-direction: column; align-items: center;
  padding: 14px 0 12px; gap: 6px; background: #0b0d12; border-right: 1px solid rgba(255,255,255,.06);
}
.wis-rail-top { padding-bottom: 10px; margin-bottom: 4px; border-bottom: 1px solid rgba(255,255,255,.07); width: 36px; display: flex; justify-content: center; }
.wis-mark {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, #3b7bff, #2159d0); color: #fff; font-weight: 800; font-size: 11.5px; letter-spacing: .5px;
  box-shadow: 0 4px 14px rgba(47,111,237,.35);
}
.wis-rail-main { display: flex; flex-direction: column; gap: 4px; flex: 1; padding-top: 6px; }
.wis-rail-bottom { display: flex; flex-direction: column; gap: 4px; }
.wis-rail-btn {
  position: relative; width: 42px; height: 42px; border-radius: 11px; border: none; background: transparent;
  color: #7c8194; display: grid; place-items: center; cursor: pointer;
  transition: background .15s, color .15s, transform .1s;
}
.wis-rail-btn:hover { background: rgba(255,255,255,.06); color: #e6e8ef; }
.wis-rail-btn:active { transform: scale(.94); }
.wis-rail-btn.active { background: rgba(59,123,255,.16); color: #8fb2ff; }
.wis-rail-btn.active::before { content: ""; position: absolute; left: -10px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: #3b7bff; }
.wis-rail-btn[hidden] { display: none; }
.wis-ic { width: 21px; height: 21px; }
.wis-ic-sm { width: 13px; height: 13px; vertical-align: -2px; }
.wis-rail-dot {
  position: absolute; top: 3px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 9px;
  background: #4b5268; color: #fff; font-size: 9.5px; font-weight: 700; line-height: 16px; text-align: center;
  box-shadow: 0 0 0 2px #0b0d12;
}
.wis-rail-dot.urgent { background: #e5484d; }
.wis-tip {
  position: absolute; left: calc(100% + 10px); top: 50%; transform: translate(-4px, -50%); white-space: nowrap;
  background: #1c1f28; color: #f1f2f6; font-size: 12px; font-weight: 550; padding: 6px 10px; border-radius: 7px;
  box-shadow: 0 6px 18px rgba(0,0,0,.35); pointer-events: none; opacity: 0; transition: opacity .12s, transform .12s; z-index: 60;
}
.wis-rail-btn:hover .wis-tip { opacity: 1; transform: translate(0, -50%); }

/* ---------------- Panneau */
.wis-panel {
  width: var(--panel-w); flex: 0 0 var(--panel-w); display: flex; flex-direction: column; min-height: 0;
  background: #11141b; padding: 14px 10px 10px; color: #c3c7d4;
}
.wis-panel > .brand { display: none; }
.wis-panel .sidebar-search-wrap { margin: 0 2px 10px; }
.wis-panel #recent-contacts-wrap { margin: 0 2px 6px; }
.wis-panel .notif-bell-wrap { margin: 0 2px 8px; }
.wis-panel .current-user-box { margin-top: 8px; border-top: 1px solid rgba(255,255,255,.07); padding-top: 10px; }
.wis-domains { flex: 1; min-height: 0; overflow-y: auto; margin: 4px -4px 0; padding: 0 4px 12px; scrollbar-color: rgba(255,255,255,.14) transparent; }
.wis-domains::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14); }

.wis-domain { display: none; }
.wis-domain.active { display: block; }
.wis-domain.wis-in { animation: wisPanelIn .22s cubic-bezier(.2,.8,.2,1) both; }
@keyframes wisPanelIn { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }
.wis-domain-title { font-size: 15px; font-weight: 700; color: #f4f5f8; letter-spacing: -.01em; padding: 8px 10px 4px; }
.wis-group { margin-top: 10px; }
.wis-group.wis-empty { display: none; }
.wis-group-label {
  font-size: 10.5px; font-weight: 650; letter-spacing: .7px; text-transform: uppercase; color: #6b7184;
  padding: 6px 10px 5px; display: flex; align-items: center; gap: 6px;
}
.wis-favs { margin-bottom: 6px; padding-bottom: 8px; border-bottom: 1px solid rgba(255,255,255,.07); }
.wis-favs[hidden] { display: none; }
.wis-favs .wis-group-label { color: #c9a227; }

.wis-row { position: relative; display: flex; align-items: center; }
.wis-row > .nav-item.hidden, .wis-favs > .nav-item.hidden { display: none !important; }
.wis-row:has(> .nav-item.hidden) { display: none; }
.sidebar.wis-sb .nav-item.wis-nav {
  flex: 1; display: flex; align-items: center; gap: 8px; width: 100%; min-height: 34px;
  padding: 7px 34px 7px 12px; border-radius: 8px; font-size: 13.5px; font-weight: 450; color: #b4b9c8;
  text-decoration: none; background: none; border: none; text-align: left; cursor: pointer;
  transition: background .12s, color .12s;
}
.sidebar.wis-sb .wis-favs .nav-item.wis-nav { padding-right: 12px; }
.sidebar.wis-sb .nav-item.wis-nav:hover { background: rgba(255,255,255,.05); color: #f1f2f6; }
.sidebar.wis-sb .nav-item.wis-nav.active { background: rgba(59,123,255,.14); color: #fff; font-weight: 600; }
.sidebar.wis-sb .nav-item.wis-nav.active::before { display: none; }
.wis-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wis-count {
  flex: 0 0 auto; min-width: 20px; height: 19px; padding: 0 6px; border-radius: 10px; font-size: 11px; font-weight: 700;
  line-height: 19px; text-align: center; background: rgba(255,255,255,.1); color: #dfe2ea; font-variant-numeric: tabular-nums;
}
.wis-count.urgent { background: #e5484d; color: #fff; }
.wis-count[hidden] { display: none; }
.wis-star {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 24px; height: 24px; border-radius: 6px;
  display: grid; place-items: center; color: #5d6377; cursor: pointer; opacity: 0; transition: opacity .12s, color .12s, background .12s;
}
.wis-row:hover .wis-star, .wis-star:focus-visible { opacity: 1; }
.wis-star:hover { background: rgba(255,255,255,.07); color: #e9c46a; }
.wis-row.is-fav .wis-star { opacity: 1; color: #e9c46a; }
.wis-row.is-fav .wis-star svg { fill: currentColor; }
.wis-row:has(.wis-count:not([hidden])) .wis-star { right: 6px; }
.wis-row:has(.wis-count:not([hidden])) .nav-item.wis-nav { padding-right: 34px; }

/* ---------------- Mobile : la barre complète glisse depuis la gauche */
@media (max-width: 780px) {
  .sidebar.wis-sb { --panel-w: min(250px, calc(100vw - 110px)); width: calc(var(--rail-w) + var(--panel-w)); }
  .wis-tip { display: none; }
  .wis-star { opacity: .55; }
  .sidebar.wis-sb .nav-item.wis-nav { min-height: 42px; font-size: 14.5px; }
}
