/* sidebar.css: Navigation links (Sidebar) mit Benutzerbox. Teil der Weboberfläche, Reihenfolge siehe index.html. */

/* ==========================================================================
   Sidebar
   ========================================================================== */
#sidebar { width: var(--sidebar-w, 240px); flex: none; background: var(--sidebar); color: var(--sidebar-text); display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 10px; padding: 16px 16px 14px; font-size: 18px; font-weight: 650; color: #fff; letter-spacing: .2px; }
.brand span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand .ver { margin-left: 4px; font-size: 10.5px; font-weight: 500; letter-spacing: 0; opacity: .6; }
.logo { flex: none; display: block; }
#menu-toggle { display: none; background: none; border: 0; color: #fff; font-size: 20px; cursor: pointer; }
#global-search { position: relative; padding: 0 12px 12px; }
#global-search .search-ico { position: absolute; left: 22px; top: 9px; color: var(--sidebar-head); pointer-events: none; }
#global-search input { width: 100%; padding: 7px 10px 7px 32px; border-radius: var(--radius); border: 1px solid var(--sidebar-border); background: var(--sidebar-2); color: #fff; transition: border-color .15s, box-shadow .15s; }
#global-search input::placeholder { color: var(--sidebar-head); }
#global-search input:focus { outline: none; border-color: #2b88c8; box-shadow: 0 0 0 3px rgba(56, 170, 238, .2); }
#menu { flex: 1; overflow-y: auto; padding: 0 8px 12px; }
#menu a { position: relative; display: flex; align-items: center; gap: 10px; margin: 1px 0; padding: 6px 10px; border-radius: var(--radius); text-decoration: none; font-size: 13.5px; transition: background .12s, color .12s; }
#menu a i { font-style: normal; width: 18px; display: grid; place-items: center; opacity: .8; }
#menu a:hover { background: var(--sidebar-2); color: #fff; }
#menu a.active { background: var(--sidebar-active); color: #fff; font-weight: 600; }
#menu a.active::before { content: ""; position: absolute; left: -8px; top: 6px; bottom: 6px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); }
#menu a.active i { opacity: 1; color: #6cc6f5; }
#menu .section { padding: 16px 10px 6px; font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .9px; color: var(--sidebar-head); display: flex; justify-content: space-between; align-items: center; }
.badge { margin-left: auto; min-width: 20px; padding: 0 6px; border-radius: 10px; font-size: 11px; font-weight: 600; line-height: 18px; text-align: center; color: #fff; }
.badge:empty { display: none; }
.badge.critical { background: var(--critical); }
.badge.warning { background: var(--warning); }
.badge.unknown { background: var(--unknown); }
.badges { margin-left: auto; display: flex; gap: 4px; }
.badges .badge { margin-left: 0; }
.sidebar-foot { display: flex; align-items: center; padding-right: 8px; }
.sidebar-foot .live { flex: 1; }
#nav-collapse .ico { transition: transform .15s; }
body.nav-rail #nav-collapse .ico { transform: rotate(180deg); }

/* einklappbare Abschnitte */
#menu .section[data-key] { cursor: pointer; user-select: none; justify-content: flex-start; gap: 4px; border-radius: var(--radius); }
#menu .section[data-key]:hover { color: var(--sidebar-text); }
#menu .section .caret { width: 12px; height: 12px; margin-left: -2px; transition: transform .15s; }
#menu .section.closed .caret { transform: rotate(-90deg); }
#menu .section .badge { margin-left: auto; }

/* Icon-Leiste: die eingeklappte Navigation */
@media (min-width: 761px) {
  body.nav-rail #sidebar { width: 60px; }
  body.nav-rail .brand { justify-content: center; padding: 16px 0 14px; }
  body.nav-rail .brand span, body.nav-rail #global-search, body.nav-rail #menu .section,
  body.nav-rail .userbox .who, body.nav-rail .live .txt, body.nav-rail #resize-sidebar { display: none; }
  body.nav-rail #menu { padding: 4px 8px 12px; }
  body.nav-rail #menu .menu-group[hidden] { display: block !important; }
  body.nav-rail #menu .menu-group + .section + .menu-group, body.nav-rail #menu-custom { border-top: 1px solid var(--sidebar-border); }
  body.nav-rail #menu a { justify-content: center; padding: 8px 0; font-size: 0; }
  body.nav-rail #menu a i { width: auto; }
  body.nav-rail #menu a .badge { position: absolute; top: 2px; right: 2px; min-width: 16px; padding: 0 4px; font-size: 10px; line-height: 15px; }
  body.nav-rail #menu a .badges { position: absolute; top: 2px; right: 2px; gap: 2px; }
  body.nav-rail #menu a .badges .badge { position: static; }
  body.nav-rail #menu a.active::before { left: -8px; }
  body.nav-rail .userbox { flex-direction: column; gap: 4px; margin: 0 6px; padding: 10px 0 6px; }
  body.nav-rail .sidebar-foot { flex-direction: column; padding: 0 0 8px; gap: 4px; }
  body.nav-rail .sidebar-foot .live { padding: 4px 0; justify-content: center; }
}
.live { padding: 8px 16px 10px; font-size: 11.5px; display: flex; align-items: center; gap: 8px; color: var(--sidebar-head); }
.live .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--sidebar-head); }
.live.on .dot { background: var(--ok); box-shadow: 0 0 0 3px rgba(68, 187, 119, .2); }
.live.off .dot { background: var(--critical); box-shadow: 0 0 0 3px rgba(255, 85, 102, .2); }

.userbox { display: flex; align-items: center; gap: 8px; margin: 0 8px; padding: 10px 6px 8px 8px; border-top: 1px solid var(--sidebar-border); }
.userbox .avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, #0ea5e9, #6366f1); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 13px; flex: none; }
.userbox .who { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.userbox .who b { color: #fff; font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.userbox .who small { color: var(--sidebar-head); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { background: none; border: 0; color: var(--sidebar-text); border-radius: var(--radius); width: 28px; height: 28px; cursor: pointer; display: grid; place-items: center; padding: 0; flex: none; transition: background .12s, color .12s; }
.icon-btn:hover { background: var(--sidebar-2); color: #fff; }
#btn-theme .ico { display: none; }
#btn-theme[data-mode="auto"] .th-auto, #btn-theme[data-mode="light"] .th-light, #btn-theme[data-mode="dark"] .th-dark { display: block; }
#btn-theme .th-auto path { stroke: none; }
