body {
    margin: 0;
    font-family: Arial, sans-serif;
    display: flex;
    height: 100vh;
  }
  
  .sidebar {
    width: 90px;
    background-color: #000;
    color: #f5c107;
    transition: width 0.3s;
    overflow: hidden;
    font-size: 20px;
  }
  
  .sidebar.open {
    width: 300px;
  }
  
  .sidebar label{
      margin-left:20px;
  }
  
  .menu-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    background-color: #444;
  }
  
  .menu-toggle .logo {
    width: 40px;
    height: 40px;
    margin-right: 10px;
  }
  
  #toggleSvg {
    transition: transform 0.3s ease-in-out;
    transform-origin: center center;
  }
  
  .sidebar.open .menu-toggle #toggleSvg {
      transform: rotate(180deg);
  }
  
  .sidebar li svg {
    margin-right: 24px;
  }
  
  .sidebar .menu-toggle {
    padding: 15px;
    cursor: pointer;
    background-color: #444;
    text-align: center;
  }
  
  
  .sidebar ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
  }
  
  .sidebar li {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    cursor: pointer;
  }
  
  .sidebar li:hover {
    background-color: #555;
  }
  
  .sidebar li i {
    margin-right: 10px;
  }
  
  .sidebar.open .label {
      display: inline;
  }
  .sidebar .label
  {
    display: none;
    white-space: nowrap;
  }
  
  .content {
    flex: 1;
    display: flex;
    flex-direction: column;
  }
  
  .navbar {
    height: 70px;
    background-color: #000;
    color: white;
    display: flex;
    align-items: center;
    padding: 0 15px;
  }
  
  .main {
    flex: 1;
    padding: 20px;
    color: white;
    background-color: #222;
  }
  
  .navbar {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding:15px 0px 0 14px;
    gap: 15px;
    background-color: #000;
    height:55px;
    color: #fff;
  }
  
  .breadcrumb {
    font-size: 14px;
    color: #f5c107;
  }
  
  .breadcrumb  a {
    color: #f5c107;
    text-decoration: none;
    font-size: 14px;
  }
  .current-label {
    font-size: 16px;
    font-weight: bold;
    color: #fff;
  }
  .pages_link_sidebar {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
  gap: 12px;
  }
  
  .pages_link_sidebar svg {
  display: block;
  }
  
  .pages_link_sidebar .label {
  line-height: 1;
  display: inline-block;
  transform: translateY(1px);
  }
  
  .filter-boxes {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
  }
  
  .filter-box {
  width: 140px;
  height: 80px;
  background-color: #eee;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  font-weight: bold;
  border: 2px solid transparent;
  border-radius: 8px;
  transition: 0.2s;
  }
  
  .filter-box:hover {
  background-color: #ddd;
  }
  
  .filter-box.active {
  border-color: blue;
  background-color: #cce5ff;
  }
  
  .device-row.hidden {
  display: none;
  }
  
  .string-visual-group {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  }
  
  .main1-header h1 {
    font-size: 1.75rem;
    font-weight: bold;
    color: #f5c107;
    margin-bottom: 0.5rem;
  }
  
  .icon-solar {
  width: 30px;
  height: 30px;
  background-color: var(--bg-color, #444);
  border: 2px solid var(--main-color, #f5c107);
  border-radius: 4px;
  }
  
  .arrow {
  font-size: 24px;
  color: var(--main-color, #f5c107);
  }
  
  .icon-inverter {
  width: 40px;
  height: 40px;
  background-color: var(--main-color, #f5c107);
  border: 2px solid var(--main-color, #f5c107);
  border-radius: 6px;
  }
  
  
  .panel-row {
  display: flex;
  gap: 6px;
  justify-content: center;
  align-items: center;
  }
  
  .panel-column {
  display: flex;
  flex-direction: column;
  gap: 6px;
  }
  
  .hidden {
  display: none;
  }
  
  .panel-control {
  margin-right: 8px;
  display: flex;
  align-items: center;
  }
  
  .toggle-details {
  padding: 4px 10px;
  font-size: 13px;
  background-color: #f5c107;
  color: #222;
  border: 1px solid #f5c107;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  }
  
  .toggle-details:hover {
  background-color: #e0b000;
  }
  
  .toggle-details .svg-icon{
  width:24px;
  height:24px;
  }
  
  .string-label {
  display: inline-block;
  width: 70px;
  font-size: 12px;
  color: #999;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  
  }
  
  .svg-icon {
  width: 24px;
  height: 24px;
  display: inline-block;
  vertical-align: middle;
  }
  
  .panel-row-with-line {
  display: flex;
  align-items: center;
  }
  
  
  
  .column-connector.active {
  height: 100%;
  opacity: 1;
  }
  
  
  
  .panel-column-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  justify-content: center;
  }
  
  .scada-row{
  display: flex;
  flex-direction: row;
  gap: 7px;
  }
  
  .inverter-wrapper{
  display: flex;
  flex-direction: column;
  gap: 20px;
  justify-content: center;
  align-items: center;
  }
  
  .all-rows-wrapper{
  align-items: right;
  justify-content: center;
  }
  
  
  .scada-left {
  scrollbar-color: #f5c107 #333;
  scrollbar-width: thin;
  overflow-x: auto;
  overflow-y: auto;
  width: 98%;
  min-width : 1000px;
  height: 70vh;
  position: relative;
  background-color: #444;
  
  background-color: #111;
  border: 1px solid #333;
  border-radius: 6px;
  padding: 1rem;
  margin-bottom: 2rem;
  
  
  }
  
  .scada-row {
  display: flex;
  gap: 0px;
  margin: 0  !important;
  flex-wrap: nowrap;
  min-width: max-content;
  
  }
  
  #line-canvas {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 1;
  overflow: visible;
  }
  
  .string-wrapper
  {
  display: flex;
  flex-direction:column;
  min-width: max-content;
  align-items: center;
  justify-content: center;
  gap:0px
  
  }
  
  .nd_drwing
  {
  position: absolute;
  right: 90px;
  bottom: 100px;
  }
  
  .compensators-grid {
  margin-top: 60px;
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* 3 kolumny */
  grid-auto-rows: auto;
  gap: 80px 0px ;
  max-width: 550px;
  }
  
  .compensates-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  }
  
  a {
  color: #f5c107;
  text-decoration: none;
  }
  
  a:hover {
  text-decoration: underline;
  }
  
  .string-wrapper {
  position: relative;
  display: inline-block;
  }
  
  .image-overlay {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 10;
  background: #000;
  padding: 4px;
  border-radius: 4px;
  box-shadow: 0 0 8px rgba(0,0,0,0.5);
  }
  
  .image-overlay img {
  max-width: 400px;
  height: auto;
  display: block;
  }
  
  .string-wrapper:hover .image-overlay {
  display: block;
  }
  
  
  .compensates-wrapper {
  position: relative;
  z-index: 2;
  }
  
  .compensates-overlay {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  
  z-index: 9999;
  }
  
  .compensates-wrapper:hover .compensates-overlay {
  display: block;
  }
  
  .compensates-overlay-container {
  position: relative;
  background: rgba(0, 0, 0, 0.85);
  padding: 4px;
  border-radius: 6px;
  box-shadow: 0 0 8px rgba(0,0,0,0.5);
  }
  
  .compensates-overlay-container img {
  max-width: 200%;
  display: block;
  }
  
  .compensates-canvas {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  }
  
  /* Kontener z dwiema kolumnami */
  .section-columns {
    display: flex;
    justify-content: space-between;
    gap: 40px;
    margin-top: 20px;
    flex-wrap: wrap; /* responsywność */
  }
  
  /* Pojedyncza kolumna (sekcja) */
  .section-box {
    flex: 1;
    background-color: #1a1a1a; /* ciemne tło */
    border: 1px solid #333;
    border-radius: 10px;
    padding: 20px;
    min-width: 300px;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.6);
  }
  
  /* Nagłówki sekcji */
  .section-box h3 {
    color: #f5c107;
    margin-bottom: 15px;
  }
  
  /* Etykiety i wartości */
  .section-box p {
    margin: 8px 0;
    font-size: 15px;
    color: #eee;
  }
  
  /* Czerwony i zielony tekst */
  .section-box .red {
    color: #ff4d4d;
    font-weight: bold;
  }
  
  .section-box .green {
    color: #5df55d;
    font-weight: bold;
  }
  
  .nd-label {
    color: white;
    font-size: 12px;
    font-weight: bold;
    position: absolute;
    white-space: nowrap;
  }
  
  .nd-label-link {
    color: #f5c107;
    font-size: 13px;
    font-weight: bold;
    text-decoration: none;
    position: absolute;
    white-space: nowrap;
    cursor: pointer;
    transition: opacity 0.2s ease;
  }
  
  .nd-label-link:hover {
    text-decoration: underline;
    opacity: 0.85;
  }
  
  .content { 
    min-width: 0; 
  }
  
  /* scena do rysowania (będzie szersza niż viewport, żeby nie było ujemnych X) */
  .scada-stage {
    position: relative;
    /* inicjalnie – JS ją i tak nadpisze po obliczeniach */
    min-width: 1200px; 
  }
  
  /* kontener scady – niech będzie pełna szerokość i poprawne liczenie paddingu */
  .scada-left {
    box-sizing: border-box;
    width: 100%;
    overflow-x: auto;
    overflow-y: auto;
    /* możesz usunąć to, jeśli chcesz pełne 100%:
    width: 98%;  */
    min-width: 0;          /* ← to pomaga na flex + overflow */
  }
  
  /* NIE twórz drugiego #line-canvas w JS, ten style zostają */
  #line-canvas {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 1;
    overflow: visible;
  }
  
  /* (opcjonalnie) na bardzo wąskich ekranach sidebar jako overlay — nie jest konieczne,
     ale często bywa wygodniejsze */
  @media (max-width: 768px) {
    .sidebar {
      position: fixed;
      left: 0; top: 0; bottom: 0;
      z-index: 1000;
    }
    .content {
      /* nie odsuwaj na stałe, sidebar i tak można zwijać */
      margin-left: 90px;   /* dopasuj do zamkniętej szerokości */
    }
    #line-canvas line { stroke-width: 10px; }
  }