:root {
  --bg-color: #2f2f2f;
  --header-color: #1f1f1f;
  --text-color: white;
  --panel-bg: #333;
  --highlight: #444;
}
[data-theme="light"] {
  --bg-color: #f3f3f3;
  --header-color: #e5e5e5;
  --text-color: #333;
  --panel-bg: #ddd;
  --highlight: #ccc;
}
body {
  margin: 0;
  font-family: "Segoe UI", sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
}
.grafana-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--header-color);
  padding: 10px 20px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.4);
  position: relative;
  z-index: 1001;
}
.logo-block {
  display: flex;
  align-items: center;
}
.burger-icon {
  font-size: 1.5em;
  cursor: pointer;
  margin-right: 15px;
}
.logo {
  font-weight: bold;
  font-size: 1.2em;
}
.search-box input {
  padding: 6px 10px;
  border-radius: 4px;
  border: none;
  font-size: 0.9em;
  max-width: 200px;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-profile {
  position: relative;
  background-color: var(--highlight);
  padding: 6px 10px;
  border-radius: 20px;
  cursor: pointer;
}
.dropdown {
  position: absolute;
  top: 40px;
  right: 0;
  background-color: var(--panel-bg);
  border-radius: 6px;
  overflow: hidden;
  display: none;
  box-shadow: 0 4px 8px rgba(0,0,0,0.5);
  z-index: 1002;
}
.dropdown a {
  display: block;
  padding: 10px 20px;
  color: var(--text-color);
  text-decoration: none;
  font-size: 0.9em;
}
.dropdown a:hover {
  background-color: var(--highlight);
}
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: none;
  z-index: 1099;
}
.sidebar {
  position: fixed;
  top: 0;
  left: -270px;
  width: 250px;
  height: 100vh;
  background-color: var(--header-color);
  box-shadow: 2px 0 5px rgba(0,0,0,0.5);
  transition: left 0.3s ease;
  padding-top: 60px;
  z-index: 1100;
  overflow-y: auto;
}
.sidebar.active {
  left: 0;
}
.sidebar a {
  display: block;
  padding: 15px 20px;
  color: var(--text-color);
  text-decoration: none;
  cursor: pointer;
}
.sidebar a:hover {
  background-color: var(--panel-bg);
}
.toggle-submenu {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.arrow {
  display: inline-block;
  transition: transform 0.3s ease;
}
.toggle-submenu.open .arrow {
  transform: rotate(90deg);
}
.submenu {
  display: none;
  flex-direction: column;
  padding-left: 20px;
}
.submenu a {
  font-size: 0.9em;
}
.toggle-submenu.open + .submenu {
  display: flex;
}
.close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 1.2em;
  cursor: pointer;
}
.theme-toggle {
  background-color: var(--highlight);
  border: none;
  padding: 6px 10px;
  border-radius: 20px;
  color: var(--text-color);
  cursor: pointer;
}
.content {
  padding: 40px;
}
@media (max-width: 600px) {
  .grafana-topbar {
    flex-direction: column;
    align-items: flex-start;
  }
  .search-box input {
    max-width: 130px;
  }
  .topbar-right {
    margin-top: 10px;
  }
}
/* Верхняя навигация */
.topnav {
  display: flex;
  gap: 1rem;
  padding: 10px 20px;
  background-color: var(--header-color);
  border-bottom: 1px solid var(--panel-bg);
  z-index: 1000;
}

.topnav-link {
  color: var(--text-color);
  text-decoration: none;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 6px;
  transition: background-color 0.3s ease;
}

.topnav-link:hover {
  background-color: var(--highlight);
}

@media (max-width: 600px) {
  .topnav {
    flex-direction: column;
    align-items: flex-start;
  }
}
