/* Navigation du dashboard Squir : rail d'icônes (groupes) + panneau des pages du groupe choisi.
   Partagée par les pages Squir (.app > .side) et les pages modules (.app.kp > .sidebar.sqs). */
.rl {
  --rl-rail: 68px; --rl-pane: 236px;
  --rl-bg: #0a0a0c; --rl-pane-bg: #111215; --rl-line: #1f2026; --rl-line2: #2a2b33;
  --rl-text: #ececf1; --rl-muted: #9a9aa8; --rl-dim: #676775;
  --rl-accent: #ff5a1f; --rl-accent2: #ff7b42; --rl-soft: rgba(255, 90, 31, .13);
  display: grid; grid-template-columns: var(--rl-rail) var(--rl-pane); height: 100%; min-height: 0;
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif; color: var(--rl-text);
}
.rl a { color: inherit; text-decoration: none } .rl button { font: inherit; color: inherit; cursor: pointer }
.rl svg.lucide { width: 18px; height: 18px; stroke-width: 1.9; flex-shrink: 0 }
.rl img { display: block; object-fit: cover }

/* Conteneurs existants : largeur et marges reprises par la navigation */
.app:has(> .side > .rl) { grid-template-columns: 304px minmax(0, 1fr) }
.side:has(> .rl), :root.squir:not([data-theme]) .kp .sidebar.sqs:has(> .rl), :root .sidebar.sqs:has(> .rl) { padding: 0 !important; gap: 0 !important; background: #111215 !important; border-right: 1px solid #1f2026 !important; overflow: visible }
:root.squir:has(.kp .sidebar.sqs > .rl) { --sidebar: 304px !important }
:root.squir:not([data-theme]) .kp .sidebar.sqs:has(> .rl), .sidebar.sqs:has(> .rl) { width: 304px !important; min-width: 304px }

/* ---------- Rail ---------- */
.rl-rail { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 0 12px; background: var(--rl-bg); border-right: 1px solid var(--rl-line); min-height: 0 }
.rl-logo { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; margin-bottom: 4px }
.rl-logo img { width: 32px; height: 32px }
.rl-logo:hover { background: #16171b }
.rl-ws { position: relative; margin: 0 0 8px }
.rl-srv { width: 44px; height: 44px; border-radius: 14px; border: 1px solid var(--rl-line2); background: #17181d; padding: 0; overflow: hidden; display: grid; place-items: center; transition: border-radius .18s ease-out, border-color .15s }
.rl-srv img { width: 100%; height: 100% }
.rl-srv span { font: 700 14px 'Red Hat Display', 'Inter', sans-serif; color: var(--rl-muted); text-transform: uppercase }
.rl-srv:hover, .rl-ws.open .rl-srv { border-color: var(--rl-accent); border-radius: 11px }
.rl-groups { flex: 1 1 auto; min-height: 0; overflow-y: auto; scrollbar-width: none; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 0; border-top: 1px solid var(--rl-line); width: 100% }
.rl-groups::-webkit-scrollbar { display: none }
.rl-g, .rl-me { position: relative; width: 42px; height: 42px; border-radius: 12px; border: 0; background: none; display: grid; place-items: center; color: var(--rl-dim); transition: background .15s, color .15s; flex-shrink: 0 }
.rl-g:hover { background: #17181d; color: var(--rl-text) }
.rl-g.on { background: var(--rl-soft); color: var(--rl-accent2); box-shadow: inset 0 0 0 1px rgba(255, 90, 31, .28) }
.rl-g:focus-visible, .rl-me:focus-visible, .rl-srv:focus-visible, .rl-logo:focus-visible { outline: 2px solid var(--rl-accent); outline-offset: 2px }
.rl-end { flex-shrink: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; padding-top: 8px; border-top: 1px solid var(--rl-line); width: 100% }
.rl-me img { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--rl-line2) }
.rl-me:hover img { border-color: var(--rl-accent) }
/* Nom du groupe au survol : bulle flottante posée par le script (le rail peut défiler) */
.rl-tip { display: none }
.rl-ftip { position: fixed; z-index: 500; transform: translate(-4px, -50%); white-space: nowrap; padding: 6px 10px; border-radius: 8px; background: #1d1e24; border: 1px solid #2a2b33; color: #ececf1; font: 600 13px 'Inter', system-ui, sans-serif; opacity: 0; pointer-events: none; transition: opacity .12s, transform .12s ease-out; box-shadow: 0 8px 22px rgba(0, 0, 0, .45) }
.rl-ftip.on { opacity: 1; transform: translate(0, -50%) }

/* Menu des serveurs, ouvert à droite du rail */
.rl .rl-menu { position: absolute; z-index: 80; left: calc(100% + 12px); top: 0; width: 280px; max-height: min(440px, 75vh); overflow-y: auto; padding: 6px; border-radius: 14px; border: 1px solid var(--rl-line2); background: #131419; box-shadow: 0 20px 44px rgba(0, 0, 0, .55); display: none }
.rl .ws.open .rl-menu { display: block; animation: rlIn .14s ease-out }
@keyframes rlIn { from { opacity: 0; transform: translateX(-6px) } to { opacity: 1; transform: none } }
.rl-menu-h { margin: 6px 8px 6px; font-size: 12.5px; font-weight: 600; color: var(--rl-dim) }
.rl .ws-it { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 9px; font-size: 13.5px; color: var(--rl-muted) }
.rl .ws-it:hover, .rl .ws-it.cur { background: #1b1c22; color: var(--rl-text) }
.rl .ws-it .gi { width: 30px; height: 30px; border-radius: 9px; background: #22232a; display: grid; place-items: center; overflow: hidden; flex-shrink: 0; font-size: 12px; font-weight: 700 }
.rl .ws-it .gi img { width: 100%; height: 100% }
.rl .ws-it b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px } .rl .ws-it small { display: block; color: var(--rl-accent2); font-size: 12px }
.rl .rl-menu hr { border: 0; border-top: 1px solid var(--rl-line); margin: 6px 0 }

/* ---------- Panneau ---------- */
.rl-pane { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--rl-pane-bg) }
.rl-head { padding: 18px 14px 6px }
.rl-head > b { display: block; font: 700 15px 'Red Hat Display', 'Inter', sans-serif; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 0 2px 12px }
.rl .rl-search { display: flex; align-items: center; gap: 9px; margin: 0; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--rl-line2); background: #0c0d10; color: var(--rl-dim) }
.rl .rl-search:focus-within { border-color: rgba(255, 90, 31, .55) }
.rl .rl-search svg { width: 15px; height: 15px }
.rl .rl-search input { flex: 1; min-width: 0; border: 0 !important; background: none !important; outline: none !important; box-shadow: none !important; padding: 0 !important; color: var(--rl-text); font: 13.5px 'Inter', system-ui, sans-serif }
.rl .rl-search input::placeholder { color: var(--rl-dim) }
.rl .rl-search input::-webkit-search-cancel-button { display: none }
.rl .rl-search kbd { padding: 1px 6px; border-radius: 5px; border: 1px solid var(--rl-line2); font: 11px ui-monospace, monospace; color: var(--rl-dim) }
.rl-nav { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 12px 12px; scrollbar-width: thin; scrollbar-color: #2a2b33 transparent }
.rl-nav::-webkit-scrollbar { width: 8px } .rl-nav::-webkit-scrollbar-thumb { background: #2a2b33; border-radius: 8px; border: 2px solid var(--rl-pane-bg) }
.rl-title { margin: 16px 6px 10px; font: 700 19px/1.2 'Red Hat Display', 'Inter', sans-serif; letter-spacing: -.02em; color: var(--rl-text) }
.rl-sh { margin: 14px 4px 6px; font-size: 12.5px; font-weight: 600; color: var(--rl-dim) }
.rl-nav [hidden], .rl [hidden] { display: none !important }
.rl .snv { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 7px 10px; border-radius: 9px; color: var(--rl-muted); font-size: 14px; font-weight: 500; border: 0; background: none }
.rl .snv span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.rl .snv svg.lucide { width: 17px; height: 17px; color: var(--rl-dim); transition: color .15s }
.rl .snv:hover { background: #17181d; color: var(--rl-text) } .rl .snv:hover svg.lucide { color: var(--rl-muted) }
.rl .snv.on { background: #1c1d23; color: var(--rl-text); font-weight: 600 } .rl .snv.on svg.lucide { color: var(--rl-accent2) }
.rl .snv:focus-visible { outline: 2px solid var(--rl-accent); outline-offset: -2px }
.rl .snv .snv-why { display: block; flex-basis: 100%; margin: 2px 0 0 27px; font-size: 11.5px; line-height: 1.35; color: #8b8b98; font-weight: 400; white-space: normal }
.rl .side-nav.searching a.snv:has(.snv-why) { flex-wrap: wrap; padding-top: 7px; padding-bottom: 7px }
.rl .side-nav.searching .rl-title { font-size: 13px; margin: 14px 4px 4px; color: var(--rl-dim) }
.rl .side-nav.simple:not(.searching) [data-rl-sec] a.snv:not([data-simple]) { display: none }
.rl-favs { padding-bottom: 6px; margin-bottom: 2px; border-bottom: 1px solid var(--rl-line) }
.rl .sq-none { margin: 14px 4px; color: var(--rl-dim); font-size: 13.5px }
.rl .sq-none button { display: flex; align-items: center; gap: 8px; margin-top: 10px; width: 100%; padding: 9px 12px; border-radius: 9px; border: 1px solid var(--rl-line2); background: none; color: var(--rl-text); font-size: 13px }
.rl .sq-none button:hover { background: var(--rl-soft); border-color: rgba(255, 90, 31, .4) }
.rl-hint { margin: 14px 4px 0; font-size: 12.5px; line-height: 1.5; color: var(--rl-dim) }
.rl-mini { width: 22px; height: 22px; border-radius: 6px; background: #22232a; overflow: hidden; flex-shrink: 0 } .rl-mini img { width: 100%; height: 100% }

.rl-foot { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px 14px; border-top: 1px solid var(--rl-line) }
.rl .rl-simple { display: flex; align-items: center; gap: 8px; width: 100%; margin: 0; padding: 8px 10px; border: 1px dashed var(--rl-line2); border-radius: 9px; background: none; color: var(--rl-muted); font-size: 12.5px; text-align: left }
.rl .rl-simple:hover { color: var(--rl-text); border-color: var(--rl-muted) } .rl .rl-simple svg { width: 15px; height: 15px }
.rl-out { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 9px; color: var(--rl-dim); font-size: 13px }
.rl-out:hover { background: #17181d; color: var(--rl-text) } .rl-out svg.lucide { width: 15px; height: 15px }
.rl .side-cta { width: 100% }

/* Téléphone : rail + panneau glissent ensemble depuis la gauche (gérés par les conteneurs existants) */
@media (max-width: 880px) {
  .app:has(> .side > .rl) { grid-template-columns: 1fr }
  .side:has(> .rl) { width: 304px }
}
@media (prefers-reduced-motion: reduce) { .rl *, .rl *::before { transition: none !important; animation: none !important } }

/* Le bas du rail reste en bas, même sans groupes (pages sans serveur) */
.rl-end { margin-top: auto }
.rl-logout:hover { color: #f87171 !important; background: rgba(248, 113, 113, .1) !important }
