:root {
    --menu-width: 330px; /* sidebar menu width */
    --navbar-height: 60px; /* navigation bar height */
    --gauge-fg-color: #8FC0DA; /* gauge foreground color */
    --gauge-bg-color: #E9ECEF; /* gauge background color */
    --sdh-border-color: #DDDDDD;
    --sdh-outline-color: #CC3333;
    --sdh-secondary-color: #111111;
    --sdh-online-color: #339933;
    --sdh-offline-color: #CC3333;
    --sdh-courtesy-color: rgb(19,75,160);
    --sdh-loader-color: #CC3333;
}

::-webkit-scrollbar-track {
    -webkit-box-shadow: inset 0 0 2px rgba(0,0,0,0.3);
    border-radius: 3px;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-thumb {
    border-radius: 3px;
    -webkit-box-shadow: inset 0 0 2px rgba(0,0,0,.3);
    background-color: var(--sdh-outline-color);
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
}
.wrapper {
    display: flex;
    flex: 1;
    position: relative;
}
.sidebar {
    width: var(--menu-width);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    padding: 20px;
    padding-top: 0px;
    transition: transform 0.3s ease;
    z-index: 1050;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.2);
}
.sidebar.collapsed {
    transform: translateX(calc(-1 * var(--menu-width)));
}
.content {
    flex-grow: 1;
    margin-left: var(--menu-width);
    padding: 10px;
    margin-top: 60px;
    transition: margin-left 0.3s ease;
}
.content.expanded {
    margin-left: 0;
}

.content-breadcrumb {
    display: flex;
    padding-top: 0px;
    padding-right: 10px;
    padding-left: 10px;
}

.navbar {
    margin-left: auto;
    width: calc(100% - var(--menu-width));
    transition: width 0.3s ease;
}
.navbar.full-width {
    width: 100%;
}

/* Mobile Sidebar Behavior */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.active {
        transform: translateX(0);
    }
    .overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1040;
        display: none;
    }
    .overlay.show {
        display: block;
    }
    .navbar {
        width: 100%;
    }
    .content {
        margin-left: 0;
    }
}

.logo {
    max-width: 92%;
}

.navbar a.nav-link {
    margin-left: 10px;
    padding: 0px;
    color: #fff;
}

.navbar a.nav-link.active {
    font-weight: bold;
    color: var(--sdh-outline-color);
}

.menu-row {
    width: 98%;
    padding: 0px;
    padding-left: 0px !important;
    color: rgba(255, 255, 255, 1);
    font-weight: bold;
    font-size: 14pt;
}

.menu-row .nav-link {
    padding: 4px;
}

.menu-row .nav-link.active {
    padding: 4px;
    color: white;
}

.menu-row:hover {
    color: rgba(0, 0, 0, .85);
    background-color: #6f777e;
}
.menu-row a:link {
    text-decoration: none;
    color: #999;
}
.menu-row a:visited {
    text-decoration: none;
    color: #999;
}
.menu-row a:hover {
    text-decoration: none;
}
.menu-row a:active {
    text-decoration: none;
    color: #999;
}

.menu-row.active {
    color: var(--sdh-outline-color);
}

.sidebar-button-container {
    padding: 5px;
}

.sidebar-button {
    color: rgba(255, 255, 255, 0.55);
    font-weight: 900
}

.page-content-wrapper {
    width: 100% !important;
}

.grid-stack {
    width: 100%;
    height: 500px;
}

.grid-stack-item-content {
    border: 1px solid lightgray;
    border-radius: 10px;
    box-shadow: 0px 4px 7px lightgray;
    box-shadow: 0px 4px 7px lightgray;
    box-shadow: 0px 4px 7px lightgray;
    text-align: center;
    font-size: 16px;
    overflow: hidden !important;
    display: flex;
    flex-direction: column;
}

.grid-stack-item-content-header {
    height: 45px;
    background-color: white;
    border-bottom: 1px solid lightgray;
    font-weight: bold;
    display: grid;
    justify-content: center;
    max-height: 50px;
    font-size: 0.85vw;
    text-align: center;
    line-height: 24px;
}

.grid-item-header-title {
    line-height: 45px;
    max-height: 45px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 60px;
}

.grid-item-header-action {
    position: absolute;
    right: 10px;
    padding-top: 5px;
}

.grid-stack-item-content-body {
    padding-bottom: 5px;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.grid-stack-item-content-body:has(.table-container) {
    padding-bottom: 45px;
}

.tooltip {
    position: absolute;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px;
    border-radius: 4px;
    pointer-events: none;
    opacity: 0; /* Hidden by default */
    transition: opacity 0.2s ease;
}

/* Legend container */
.legend {
    display: flex;
    flex-flow: row wrap;
    justify-content: space-evenly;
    align-items: flex-start;
    margin-top: 20px;
    max-height: 40px;
}

.legend-item {
    height: 15px;
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

.legend-color {
    width: 15px;
    height: 15px;
    display: inline-block;
    margin-right: 8px;
    border-radius: 3px;
}

.chart-pie-box {
    padding: 10px;
    width: 100%;
}

.single-value {
    font-size: x-large;
    font-weight: bold;
}

.line {
    fill: none;           /* No fill */
    stroke-width: 2;      /* Line thickness */
}

.axis path,
.axis line {
    fill: none;
    shape-rendering: crispEdges;
}

.axis text {
    font-size: 12px;
}

.grid line {
    stroke: #ddd; /* Grid line color */
    stroke-width: 1;
    shape-rendering: crispEdges;
}

.grid path {
    stroke-width: 0;
}

.circle {
    /* fill: steelblue; */
    /* stroke: white; */
    stroke-width: 0;
}

.table-container {
    width: 100%;
    height: 100%;
    overflow: auto;
}

.table-container tr {
    line-height: 15px;
}

.ts-wrapper {
    height: 100% !important;
}

.ts-dropdown {
    background-color: white;
}

.chart-barchart-box .bar {
    fill: steelblue;
}

.custom-tooltip .tooltip-inner {
    text-align: left;
    max-width: 300px;
    background-color: inherit;
}

.wunderbaum {
    background-color: rgba(0, 0, 0, 0) !important;
    border: 0px solid black !important;
    border-radius: 0px !important;
}

.wunderbaum:focus-visible {
    outline: none;
}

#menu-tree .wb-node-list {
    height: 100% !important;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    overflow-y: auto;
}

#menu-tree .wb-row {
    width: 98%;
    position: relative;
    padding: 0px;
    color: rgba(255, 255, 255, 0.75);
    font-weight: bold;
    font-size: 14pt;
    min-height: 28px;
    height: 28px;
    top: 0px !important;
}

#menu-tree .wb-row:hover {
    background-color: gray;
    border-radius: 6px;
}

#menu-tree .wb-row.wb-active {
    background-color: rgba(0, 0, 0, 0);
    border-color: rgba(0, 0, 0, 0);
    color: var(--sdh-outline-color);
}

#menu-tree .wb-row.wb-active:hover {
    background-color: gray;
}

#menu-tree .wb-title {
    width: 90%;
    margin-top: 3px;
    margin-left: 4px;
    font-size: 16px;
    font-weight: 600;
    font-family: var(--bs-btn-font-family)
}

#menu-tree .wb-expander {
    color: rgba(255, 255, 255, 0.5);
}

#menu-tree .wb-expander.collapsed {
    /*width: 0px;*/
    margin-left: -5px;
}

#menu-tree .wb-icon {
    margin-left: 1px;
    margin-right: 4px;
}

#menu-tree .wb-node {
    height: 100%;
    display: flex;
    flex-direction: row;
    align-items: center;
}

/* --- 1. General Legend Container (.legend) --- */
.chart-line-box .legend {
    position: absolute;
    top: 37px;
    left: 57px;
    padding: 10px;
    
    background: rgba(255, 255, 255, 0); /* Keep a slightly transparent white background */
    
    z-index: 10;
    font-family: sans-serif;
}
.chart-barchart-box .legend {
    position: absolute;
    top: 37px;
    left: 57px;
    padding: 10px;
    
    background: rgba(255, 255, 255, 0); /* Keep a slightly transparent white background */
    
    z-index: 10;
    font-family: sans-serif;
}
/* --- 2. Legend Header (Clickable part) --- */
.legend-header {
    font-weight: bold;
    cursor: pointer;
    padding-right: 5px;
    padding-bottom: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #333;
    margin-bottom: 5px;
}

/* --- 3. Legend Content (The Animating Part) --- */
.legend-content {
    /* DEFAULT (Expanded) state: large max-height */
    max-height: 500px;
    overflow: hidden; /* Clips content during collapse/expand */
    transition: max-height 0.3s ease-in-out; /* Smooth transition */
}

/* --- 4. Collapsed Summary Placeholder --- */
.legend-summary {
    display: none; /* Hidden by default when expanded */
    font-size: 12px;
    color: #666;
    font-style: italic;
    cursor: pointer;
}

/* --- 5. Caret Circle (Outer Container for Rotation) --- */
.caret-circle {
    display: flex; /* Centers the triangle */
    justify-content: center;
    align-items: center;
    width: 18px; /* Diameter */
    height: 18px; /* Diameter */
    border: 1px solid #aaa; /* Border of the circle */
    border-radius: 50%; /* Makes it a circle */
    margin-left: 10px;
    transition: transform 0.3s ease; /* Smooth rotation transition */
    user-select: none;
}

/* --- 6. Caret Triangle (Inner Arrow) --- */
.caret-triangle {
    display: inline-block;
    width: 0;
    height: 0;
    
    /* Default (Expanded) State: Downward pointing triangle */
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid #333;
    border-bottom: 0;
}

/* --- 7. Collapsed State Modifiers (Targeting .legend-collapsed) --- */

/* 7a. Animate Content Height to 0 */
.legend-collapsed .legend-content {
    max-height: 0; /* Complete collapse */
    width: 0px;
}

/* 7b. Show the summary placeholder */
.legend-collapsed .legend-summary {
    display: block; 
}

/* 7c. Rotate the entire circle container */
.legend-collapsed .caret-circle {
    transform: rotate(-90deg); /* Points to the side */
}
