/* ============================================
   FOMS BMS Demo - Style CSS
   Wierne odwzorowanie 1:1 systemu Niagara/Supervisor
   Czcionka: Roboto (Google Fonts)
   Ikony: wylacznie svglibv2
   ============================================ */

/* === RESET & BASE === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow: hidden;
    background: #141414;
}

body {
    font-family: 'Roboto', sans-serif;
    font-size: 12px;
    color: #b0aeae;
    background: #141414;
    overflow: hidden;
    transform-origin: top left;
}
/* Przejścia stron: shell (sidebar/header) widoczny od razu, content fade */
#main-content, .hvac-scroll {
    opacity: 0;
    transition: opacity 0.2s ease;
}
body.loaded #main-content,
body.loaded .hvac-scroll { opacity: 1; }
body.fade-out #main-content,
body.fade-out .hvac-scroll { opacity: 0; }

/* === LAYOUT GRID === */
/* PX master: TopMenu(0,0,1910,105) Side(5,105,130,910) Workspace(140,105,1762,955)
   Row: 90px + 15px gap = 105px. Col: 120px + 10px gap = 130px (PX=140, offset=+10px) */
body {
    display: grid;
    grid-template-rows: 90px 1fr;
    grid-template-columns: 120px 1fr;
    gap: 15px 14px;
    grid-template-areas:
        "logo header"
        "sidebar main";
    width: 1910px;
    height: 1060px;
}

/* ============================================
   LOGO BOX - osobna wyspa (island)
   Oddzielona gapem od headera i sidebara
   ============================================ */
#logo-box {
    grid-area: logo;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #262626;
    padding: 6px;
    border: 2px solid;
    border-image: linear-gradient(180deg, #0c0c0c, #141414) 1;
}

.header-logo-blaks {
    width: 65px;
    height: 65px;
    object-fit: contain;
}

/* ============================================
   HEADER
   Z TopMenu.png: 64px, logo w boxie, FOMS duzy,
   separatory miedzy kazda sekcja, zegar 36px
   ============================================ */
#header {
    grid-area: header;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #262626;
    padding: 0 33px 0 0;
    z-index: 100;
    height: 90px;
    overflow: visible;
    border: 2px solid;
    border-image: linear-gradient(180deg, #0c0c0c, #141414) 1;
}

.header-left {
    display: flex;
    align-items: center;
    height: 100%;
    gap: 0;
}

/* FOMS title — absolute positioning matching PX layout
   PX: FOMS logo layout="120,-45,230,160" subtitle layout="153,55,325,30"
   Header starts at PX x=134, so offsets: logo x=-14, subtitle x=19 */
.header-title {
    position: relative;
    width: 345px;
    height: 100%;
}

.header-logo-foms {
    position: absolute;
    left: -14px;
    top: -45px;
    width: 230px;
    height: 160px;
    object-fit: contain;
}

.header-subtitle {
    position: absolute;
    left: 23px;
    top: 55px;
    color: #b0aeae;
    font-size: 18px;
    font-weight: 300;
    letter-spacing: 0;
    white-space: nowrap;
}

.header-right {
    display: flex;
    align-items: center;
    height: 100%;
    gap: 0;
}

/* User section - separator centered between user and nav */
.header-user {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 0;
    color: #b0aeae;
    padding: 12px 0 0 0;
    height: 100%;
}
.header-user::after {
    content: '';
    position: absolute;
    right: -16px;
    top: 15px;
    width: 2px;
    height: 65px;
    background: #545454;
}

.icon-user {
    width: 50px;
    height: 50px;
    filter: brightness(0) invert(1);
}

.user-name {
    white-space: nowrap;
    font-size: 17px;
    font-weight: 300;
}

.header-nav-buttons {
    display: flex;
    height: 100%;
    gap: 0;
    margin-left: 30px;
    margin-right: 30px;
}

.nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 0;
    background: none;
    border: none;
    color: #b0aeae;
    cursor: pointer;
    padding: 12px 0 0;
    font-family: 'Roboto', sans-serif;
    font-size: 16px;
    font-weight: 300;
    width: 70px;
    height: 100%;
    transition: color 0.15s;
}
.nav-btn span {
    margin-top: -4px;
}
/* PX non-uniform gaps: Start→Powrót=15, Powrót→Naprzód=15, Naprzód→Odśwież=20, Odśwież→Wyloguj=20 */
.nav-btn:nth-child(1) { margin-right: 15px; }
.nav-btn:nth-child(2) { margin-right: 15px; }
.nav-btn:nth-child(3) { margin-right: 20px; }
.nav-btn:nth-child(4) { margin-right: 20px; }

.nav-icon {
    width: 50px;
    height: 50px;
    opacity: 1;
}

.nav-btn:hover {
    color: inherit;
    background: none;
}

.header-clock {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    line-height: 1;
    padding: 0;
    height: 100%;
}
.header-clock::before {
    content: '';
    position: absolute;
    left: -16px;
    top: 15px;
    width: 2px;
    height: 65px;
    background: #545454;
}

#clock-time {
    color: #fff;
    font-size: 46px;
    font-weight: 300;
    letter-spacing: 1px;
}

#clock-date {
    color: #b0aeae;
    font-size: 20px;
    font-weight: 300;
}

/* ============================================
   SIDEBAR — PX: Side_menu_1.px, viewSize 130×910
   Polygon 120×910 fill=#262626
   4 sections each 120×85, separators at y=85,170,255,340
   ============================================ */
#sidebar {
    grid-area: sidebar;
    background: #262626;
    overflow: visible;
    position: relative;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    width: 120px;
}

.sidebar-item {
    position: relative;
    width: 120px;
    height: 85px;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s;
}

/* PX separators: Line stroke=#545454 geom=13,y→107,y (94px wide) */
.sidebar-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 13px;
    width: 94px;
    height: 1px;
    background: #545454;
}

.sidebar-item:hover {
    outline: 2px solid #fff;
    outline-offset: -2px;
}
.sidebar-item:hover::after {
    background: transparent;
}

.sidebar-item.active {
    /* brak podswietlenia — tylko hover daje obramowke */
}

/* All sidebar icons: absolute positioned, white filter */
.si-icon {
    position: absolute;
    filter: brightness(0) invert(1);
    object-fit: contain;
    z-index: 2;
}

/* Background/secondary icons: dimmer, behind main icon */
.si-bg {
    opacity: 0.5;
    z-index: 1;
}

/* All sidebar labels: absolute, full-width centered */
.si-label {
    position: absolute;
    left: 0;
    width: 120px;
    color: #b0aeae;
    font-family: 'Roboto', sans-serif;
    font-size: 16px;
    font-weight: 300;
    text-align: center;
    line-height: 1.2;
}

/* === Oświetlenie (PX y=0-85) === */
.si-bulb { left: 41px; top: 14px; width: 38px; height: 38px; }
.si-label-osw { top: 60px; }

/* === Pomiar (PX y=85-170) === */
.si-speedometer { left: 41px; top: 14px; width: 38px; height: 38px; }
.si-label-pomiar { top: 60px; }

/* === HVAC (PX y=170-255) === */
.si-snowflake { left: 26px; top: 15px; width: 23px; height: 23px; }
.si-thermometer { left: 69px; top: 14px; width: 23px; height: 23px; }
.si-fan { left: 41px; top: 14px; width: 38px; height: 38px; }
.si-label-hvac { top: 60px; }

/* === Ugięcia dachu (y=255-340) === */
.si-deflection { left: 35px; top: 8px; width: 50px; height: 50px; }
.si-label-dach { top: 60px; }

/* Pasek akcentu — tylko gdy aktywna zakladka */
.si-dach.active::before {
    content: '';
    position: absolute;
    right: -4px;
    top: 0;
    width: 4px;
    height: 85px;
    background: #ba85f9;
    z-index: 50;
}

/* === Stan systemu (y=340-425) === */
.si-system.active::before {
    content: '';
    position: absolute;
    right: -4px;
    top: 0;
    width: 4px;
    height: 85px;
    background: orangeRed;
    z-index: 50;
}

/* Badge alarmowy — czerwone migajace kolko z liczba */
.si-alarm-badge {
    position: absolute;
    top: 8px;
    right: 22px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 10px;
    background: #ef4141;
    color: white;
    font-family: 'Roboto', sans-serif;
    font-weight: 300;
    font-size: 11px;
    line-height: 20px;
    text-align: center;
    z-index: 60;
    animation: alarm-pulse 1.5s ease-in-out infinite;
}
@keyframes alarm-pulse {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

/* === Stan systemu (PX y=340-425) === */
.si-heartrate { left: 41px; top: 14px; width: 38px; height: 38px; }
.si-label-system { top: 60px; }

/* ============================================
   SIDEBAR SUBMENU (Side_menu_Licz.px 65×280)
   Panel wysuwany z prawej strony sidebara
   PX: layout="130,190,65,280" = x=130 y=190 (page coords)
   CSS: sidebar ends at 120px, gap 14px, so submenu at left=134px
   y=190 from page top = 105px header + 85px Oswietlenie = 190px
   ============================================ */
.sidebar-submenu {
    position: absolute;
    left: 124px;
    top: 85px;
    width: 65px;
    height: 280px;
    background: #262626;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    z-index: 50;
}

/* Zielony pasek wskaznikowy — wysokosc sekcji Pomiar (85px) */
.sidebar-submenu::before {
    content: '';
    position: absolute;
    left: -4px;
    top: 0;
    width: 4px;
    height: 85px;
    background: #69fe5f;
    border-radius: 0;
}

.submenu-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    text-decoration: none;
    cursor: pointer;
    flex-shrink: 0;
}

.submenu-icon {
    width: 27px;
    height: 27px;
    object-fit: contain;
}

.submenu-icon-dl {
    width: 26px;
    height: 26px;
}

/* Aktywna pozycja submenu — ikonka biala */
.submenu-item.active .submenu-icon {
    filter: brightness(0) invert(1);
}

/* ============================================
   BREADCRUMB
   ============================================ */
/* PX: icon(95,15) title(128,0) separator(85,50→595,50) +10px offset */
#breadcrumb {
    position: absolute;
    left: 95px;
    top: 0;
    width: 510px;
    height: 50px;
    background: transparent;
    display: flex;
    align-items: flex-start;
    z-index: 50;
}

#breadcrumb::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 510px;
    height: 2px;
    background: #262626;
}

/* PX: icon at workspace x=95 (=CSS 105), title at x=128 (=CSS 138)
   breadcrumb div starts at CSS left:95 (=separator start), so content needs +10px */
.breadcrumb-content {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 8px;
    padding-left: 10px;
}

.breadcrumb-icon {
    width: 25px;
    height: 25px;
    margin-top: 15px;
}

.breadcrumb-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.breadcrumb-title {
    font-size: 20px;
    font-weight: 400;
    color: #676565;
}

.breadcrumb-subtitle {
    font-size: 15px;
    font-weight: 300;
    color: #676565;
}

/* ============================================
   MAIN CONTENT
   Z Homepage.png: 3 panele WYRAZNIE ODDZIELONE
   Proporcje kolumn ~1:2:1
   Gap miedzy panelami ~10px
   ============================================ */
/* PX: Homepage_Workspace.px viewSize="1762,955" — absolute positioning like CanvasPane */
#main-content {
    grid-area: main;
    position: relative;
    overflow: hidden;
    background: transparent;
}

/* ============================================
   LEWA KOLUMNA - GAUGE CARDS
   ============================================ */
/* PX: gauges at (85, 85/345/605), 490×245, gap=15px uniform (+10px offset) */
.col-gauges {
    position: absolute;
    left: 95px;
    top: 70px;
    width: 490px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    overflow: hidden;
    background: transparent;
}

/* Gauge cards — PX: Rect fill=#262626, 490×245 */
.gauge-card {
    position: relative;
    background: #262626;
    width: 490px;
    height: 245px;
    flex: none;
    overflow: hidden;
}

/* Title — PX: layout=30,15,290,25 font="bold 18pt Roboto Thin" padding=0 0 0 5 */
.gc-title {
    position: absolute;
    left: 30px; top: 15px;
    width: 290px; height: 25px;
    font-size: 18px;
    font-weight: 300;
    color: #b0aeae;
    padding-left: 5px;
}

/* Accent line — PX: Line geom=25,48→465,48, no pen specified (default=1) */
.gc-line {
    position: absolute;
    left: 25px; top: 48px;
    width: 440px;
    height: 1px;
}
.gc-line.green { background: #69fe5f; }
.gc-line.blue { background: #5fc1fe; }
.gc-line.yellow { background: #fef95f; }

/* Gauge arc SVG image (full 160x160, bottom half transparent) */
.gc-gauge-img {
    position: absolute;
    left: 40px; top: 50px;
    width: 160px; height: 160px;
    object-fit: contain;
}

/* % number — PX gauge(32,60,82,50) → panel(72,110,82,50) bold 45pt halign=center */
.gc-pct {
    position: absolute;
    left: 72px; top: 110px;
    width: 82px; height: 50px;
    text-align: center;
    font-size: 45px;
    font-weight: 300;
    color: white;
    white-space: nowrap;
    line-height: 1;
    overflow: visible;
}
/* % sign — PX gauge(90,79,36,30) → panel(130,129). Relative to gc-pct: left=58,top=19, padding=0 2 */
.gc-pct .gc-pct-sign {
    position: absolute;
    left: 58px; top: 19px;
    width: 36px; height: 30px;
    font-size: 20px;
    font-weight: 300;
    line-height: 30px;
    padding: 0 2px;
}

@keyframes gc-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}
.gc-blink {
    animation: gc-blink 1s infinite;
}

/* kW / rate value — PX: gauge(20,110,120,40) → panel(60,160,120,40) 22pt */
.gc-kw {
    position: absolute;
    left: 60px; top: 160px;
    width: 120px; height: 40px;
    font-size: 22px;
    font-weight: 300;
    color: white;
    text-align: center;
    white-space: nowrap;
    line-height: 40px;
}

/* kWh / total value - PX: layout="70,190,103,30" */
.gc-kwh {
    position: absolute;
    left: 70px; top: 190px;
    width: 103px;
    font-size: 16px;
    font-weight: 300;
    color: white;
    text-align: center;
    white-space: nowrap;
}

/* Mini chart icons (15x15) */
.gc-icon {
    position: absolute;
    width: 15px; height: 15px;
    opacity: 0.7;
    cursor: pointer;
}
.gc-icon:hover { opacity: 1; }

/* Vertical separator lines */
.gc-vline {
    position: absolute;
    width: 1px;
    background: #b0aeae;
}

/* Main value icons + separator - PX: vline(190,180→207), icons(200,175/195) */
.gc-vline-main { left: 190px; top: 180px; height: 27px; }
.gc-icon-m1 { left: 200px; top: 175px; }
.gc-icon-m2 { left: 200px; top: 195px; }


/* === DETAIL SECTIONS (Energy card) === */
/* Oświetlenie — PX: label(270,79,115,25) padding=0 0 0 5 */
.gc-osw-label {
    position: absolute;
    left: 270px; top: 79px;
    width: 115px; height: 25px;
    font-size: 16px;
    font-weight: 300;
    color: #b0aeae;
    padding-left: 5px;
}
/* PX: pct(260,95,50,45) bold 30pt halign=right valign=bottom → top=95+45-30=110 */
.gc-osw-pct {
    position: absolute;
    left: 260px; top: 110px;
    width: 50px;
    font-size: 30px;
    font-weight: 300;
    color: #b0aeae;
    text-align: right;
    line-height: 1;
}
/* PX: %(300,111,38,25) bold 15pt valign=bottom → top=111+25-15=121, left pushed right to avoid overlap */
.gc-osw-pct-sign {
    position: absolute;
    left: 312px; top: 121px;
    font-size: 15px;
    font-weight: 300;
    color: #b0aeae;
}
.gc-vline-osw { left: 335px; top: 108px; height: 27px; }
/* PX: osw kW(345,96,60,25) 15pt halign=left valign=bottom → top=96+25-15=106 */
.gc-osw-kw {
    position: absolute;
    left: 345px; top: 106px;
    width: 60px;
    font-size: 15px;
    font-weight: 300;
    color: white;
    white-space: nowrap;
}
/* PX: osw kWh(345,117,118,25) — bottom-aligned with osw-pct(30px@110): 110+30-15=125 */
.gc-osw-kwh {
    position: absolute;
    left: 345px; top: 125px;
    width: 118px; height: 25px;
    font-size: 15px;
    font-weight: 300;
    color: white;
    white-space: nowrap;
    padding: 1px;
}
.gc-vline-osw-i { left: 440px; top: 108px; height: 27px; }
.gc-osw-i1 { left: 450px; top: 102px; }
.gc-osw-i2 { left: 450px; top: 120px; }

/* HVAC — PX: label(270,155,115,25) padding=0 0 0 5 */
.gc-hvac-label {
    position: absolute;
    left: 270px; top: 155px;
    width: 115px; height: 25px;
    font-size: 16px;
    font-weight: 300;
    color: #b0aeae;
    padding-left: 5px;
}
/* PX: pct(260,170,50,45) bold 30pt halign=right valign=bottom → top=170+45-30=185 */
.gc-hvac-pct {
    position: absolute;
    left: 260px; top: 185px;
    width: 50px;
    font-size: 30px;
    font-weight: 300;
    color: #b0aeae;
    text-align: right;
    line-height: 1;
}
/* PX: %(300,186,38,25) bold 15pt valign=bottom → top=186+25-15=196, left pushed right to avoid overlap */
.gc-hvac-pct-sign {
    position: absolute;
    left: 312px; top: 196px;
    font-size: 15px;
    font-weight: 300;
    color: #b0aeae;
}
.gc-vline-hvac { left: 335px; top: 183px; height: 27px; }
/* PX: hvac kW(345,171,60,25) 15pt halign=left valign=bottom → top=171+25-15=181 */
.gc-hvac-kw {
    position: absolute;
    left: 345px; top: 181px;
    width: 60px;
    font-size: 15px;
    font-weight: 300;
    color: white;
    white-space: nowrap;
}
/* PX: hvac kWh(345,192,118,25) — bottom-aligned with hvac-pct(30px@185): 185+30-15=200 */
.gc-hvac-kwh {
    position: absolute;
    left: 345px; top: 200px;
    width: 118px; height: 25px;
    font-size: 15px;
    font-weight: 300;
    color: white;
    white-space: nowrap;
    padding: 1px;
}
.gc-vline-hvac-i { left: 440px; top: 183px; height: 27px; }
.gc-hvac-i1 { left: 450px; top: 178px; }
.gc-hvac-i2 { left: 450px; top: 196px; }

/* === WATER/GAS MYŚLNIKI === */
/* PX: layout="250,170,245,25" font="16pt Roboto Light" padding=0 0 0 5 */
.gc-myslnik-1 {
    position: absolute;
    left: 250px; top: 170px;
    width: 245px; height: 25px;
    font-size: 16px;
    font-weight: 300;
    color: #b0aeae;
    white-space: nowrap;
    padding-left: 5px;
}
/* PX: layout="250,190,180,25" font="16pt Roboto Light" padding=0 0 0 5 */
.gc-myslnik-2 {
    position: absolute;
    left: 250px; top: 190px;
    width: 180px; height: 25px;
    font-size: 16px;
    font-weight: 300;
    color: #b0aeae;
    white-space: nowrap;
    padding-left: 5px;
}

/* ============================================
   SRODKOWA KOLUMNA - WYKRESY
   Z Charts.png: 3 karty oddzielone gapami ~10px
   ============================================ */
/* PX: charts at (591, 85/350/605), 550×(245/240/245)
   Non-uniform gaps: power→water=20px, water→gas=15px (+10px offset) */
.col-charts {
    position: absolute;
    left: 601px;
    top: 70px;
    width: 550px;
    display: flex;
    flex-direction: column;
    gap: 0;
    background: transparent;
}

.chart-card {
    background: #262626;
    height: 245px;
    flex: none;
    display: flex;
    flex-direction: column;
    min-height: 0;
    position: relative;
    z-index: 1;
    overflow: visible;
}
.chart-card:has(.chart-dropdown.open) {
    z-index: 100;
}

/* PX non-uniform: chart1 h=245 gap=20, chart2 h=240 gap=15, chart3 h=245
   Total: 85+245+20+240+15+245=850, matches gauge column bottom */
.col-charts .chart-card:nth-child(1) { height: 245px; margin-bottom: 15px; }
.col-charts .chart-card:nth-child(2) { height: 245px; margin-bottom: 15px; }
.col-charts .chart-card:nth-child(3) { height: 245px; }

/* Toolbar row: dropdown only */
.chart-header-toolbar {
    display: flex;
    align-items: center;
    padding: 3px 10px 2px;
    gap: 6px;
}

/* Title row: title + legend — right padding matches chart grid.right */
.chart-header-title-row {
    display: flex;
    align-items: center;
    padding: 2px 38px 1px 14px;
    gap: 12px;
}

/* === Custom chart dropdown (matching ChartAttributes.png) === */
.chart-dropdown {
    position: relative;
    flex-shrink: 0;
}
.chart-dropdown.open {
    z-index: 300;
}
.chart-dropdown-btn {
    background: #333;
    color: #ccc;
    border: 1px solid #545454;
    border-radius: 0;
    padding: 3px 6px 3px 8px;
    font-family: 'Roboto', sans-serif;
    font-size: 13px;
    font-weight: 400;
    cursor: pointer;
    outline: none;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
}
.chart-dropdown-btn:hover { border-color: #666; }
.dd-arrow {
    font-size: 9px;
    color: #aaa;
    margin-left: 2px;
}
.chart-dropdown-list {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 160px;
    background: #2d2d2d;
    border: 1px solid #444;
    z-index: 200;
    max-height: 340px;
    overflow-y: auto;
    padding: 2px 0;
}
/* Gas chart (bottom) — dropdown opens upward */
.chart-dropdown.drop-up .chart-dropdown-list {
    top: auto;
    bottom: 100%;
}
.chart-dropdown.open .chart-dropdown-list { display: block; }
.chart-dropdown-item {
    padding: 3px 12px;
    color: #ddd;
    font-family: 'Roboto', sans-serif;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
}
.chart-dropdown-item:hover { background: #1a6fbf; color: #fff; }
.chart-dropdown-item.active { background: #1a6fbf; color: #fff; }

.chart-title {
    font-size: 15px;
    font-weight: 400;
    color: #ddd;
    flex: 1;
}

.chart-legend {
    display: flex;
    gap: 5px;
}

.legend-box {
    width: 14px;
    height: 14px;
    border-radius: 0;
    cursor: pointer;
    position: relative;
}

/* Settings gear button */
.chart-settings-btn {
    background: none;
    border: none;
    color: #777;
    font-size: 16px;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
    opacity: 0.6;
    transition: opacity 0.15s;
}
.chart-settings-btn:hover { opacity: 1; color: #bbb; }

/* === Settings Modal === */
.settings-modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.settings-modal {
    background: #2a2a2a;
    border: 1px solid #444;
    width: 620px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}
.settings-title {
    color: #03dac5;
    font-size: 16px;
    font-weight: 400;
    padding: 14px 20px 8px;
}
.settings-toolbar {
    display: flex;
    gap: 10px;
    padding: 4px 20px 10px;
}
.stb-svg {
    width: 16px;
    height: 16px;
    color: #888;
    cursor: pointer;
    flex-shrink: 0;
}
.stb-svg:hover { color: #ccc; }
.settings-header-bar {
    background: #e0e0e0;
    padding: 4px 10px;
    display: flex;
    gap: 10px;
}
.settings-tab {
    font-size: 11px;
    color: #333;
    padding: 2px 8px;
    cursor: pointer;
}
.settings-tab.active {
    background: #ccc;
    font-weight: 500;
}
.settings-series-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}
.settings-series-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    border-bottom: 1px solid #333;
}
.ss-folder {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    color: #888;
}
.ss-folder svg { width: 14px; height: 14px; }
.ss-name {
    flex: 1;
    color: #ccc;
    font-size: 13px;
    white-space: nowrap;
}
.ss-color-swatch {
    width: 55px;
    height: 22px;
    border-radius: 3px;
    flex-shrink: 0;
}
.ss-hex {
    color: #999;
    font-size: 12px;
    font-family: monospace;
    min-width: 60px;
}
.ss-chart-types {
    display: flex;
    gap: 4px;
}
.ss-type-icon {
    width: 26px;
    height: 26px;
    background: #3a3a3a;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #777;
    cursor: pointer;
}
.ss-type-icon svg { width: 14px; height: 14px; }
.ss-type-icon:hover { background: #4a4a4a; color: #bbb; }
.ss-type-icon.active { background: #4a4a4a; color: #ddd; }
.settings-buttons {
    display: flex;
    justify-content: center;
    gap: 16px;
    padding: 16px 20px;
    border-top: 1px solid #444;
}
.settings-btn {
    background: #444;
    color: #ccc;
    border: none;
    border-radius: 14px;
    padding: 6px 28px;
    font-family: 'Roboto', sans-serif;
    font-size: 12px;
    cursor: pointer;
}
.settings-btn:hover { background: #555; color: #fff; }

/* === Pinned tooltips === */
.pinned-tooltip {
    position: absolute;
    background: rgba(20,20,24,0.95);
    border: 1px solid #444;
    color: #ccc;
    font-size: 11px;
    font-family: 'Roboto', sans-serif;
    padding: 6px 10px;
    z-index: 80;
    pointer-events: auto;
    white-space: nowrap;
}
.pinned-tooltip .pin-close {
    position: absolute;
    top: 1px; right: 4px;
    cursor: pointer;
    color: #777;
    font-size: 12px;
    line-height: 1;
}
.pinned-tooltip .pin-close:hover { color: #fff; }

.chart-area {
    flex: 1;
    min-height: 100px;
}

/* ============================================
   PRAWA KOLUMNA - KONSOLA ALARMOWA
   ============================================ */
/* PX: console bg rect(1155,80,575,610) fill=#2f2f2f
   Console widget(1157,140,570,713) — extends to y=853 (+10px offset) */
/* PX: rect(1155,80,575,610) fill=#2f2f2f, pen=3 gradient(#0c0c0c→#141414 90°) */
.col-console {
    position: absolute;
    left: 1165px;
    top: 70px;
    width: 575px;
    height: 773px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #2f2f2f;
}

.console-card {
    background: #1a1a1a;
    flex: 1;
    display: flex;
    overflow: hidden;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

/* PX: icon(1182,93)=27px from console left, 13px from top
   title(1210,90)=55px from left, 10px from top
   alarm line at y=125 = 45px from console top (80) */
.console-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px 16px 27px;
    background: #2f2f2f;
    position: relative;
}
.console-header::after {
    content: '';
    position: absolute;
    bottom: 6px;
    left: 27px;
    right: 27px;
    height: 2px;
    background: #555;
}

.console-icon {
    width: 22px;
    height: 22px;
}

.console-title {
    color: #ccc;
    font-size: 18px;
    font-weight: 300;
}

.console-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px 10px;
    font-size: 11px;
    font-weight: 400;
    background: #1a1a1a;
}

.console-toolbar-left {
    display: flex;
    align-items: center;
}

.console-toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #777;
}

.console-filter-icon {
    width: 16px;
    height: 16px;
    opacity: 0.6;
    cursor: pointer;
}

.console-timerange {
    font-family: 'Roboto', sans-serif;
    font-size: 11px;
    padding: 3px 6px;
    background: #333;
    color: #999;
    border: none;
    border-radius: 3px;
    cursor: pointer;
}
.console-clock-icon {
    width: 18px;
    height: 18px;
    margin-left: 6px;
    cursor: pointer;
    opacity: 0.7;
}
.console-clock-icon:hover { opacity: 1; }

/* Konsola pelnostronicowa (submenu pomiar/hvac) */
.ka-console-card {
    position: absolute;
    left: 85px;
    top: 35px;
    right: 10px;
    bottom: 10px;
}
.console-card-full {
    background: #222 !important;
}
.console-card-full .console-toolbar {
    background: #222 !important;
    border-bottom: 25px solid #3a3a3a !important;
}
.console-card-full .console-scroll-area {
    background: #222 !important;
}
.console-card-full .console-buttons {
    background: #222 !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    justify-content: center !important;
    gap: 6px !important;
    padding: 10px 20px !important;
}
.console-card-full .console-timerange {
    font-size: 12px;
    padding: 4px 8px;
}

/* Edit Time Range dialog */
.etr-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
}
.etr-overlay.hidden { display: none; }
.etr-box {
    background: #2a2a2a;
    border: 1px solid #444;
    min-width: 360px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.6);
}
.etr-title {
    padding: 12px 16px;
    font-size: 14px;
    color: #bbb;
    font-weight: 300;
}
.etr-body { padding: 6px 16px 10px; }
.etr-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.etr-row input[type="checkbox"] { width: 14px; height: 14px; accent-color: #666; }
.etr-label { color: #ccc; font-size: 12px; width: 65px; }
.etr-date-input {
    background: #1a1a1a;
    border: 1px solid #444;
    color: #ccc;
    font: 300 12px 'Roboto', sans-serif;
    padding: 4px 8px;
    width: 110px;
    outline: none;
}
.etr-time-input {
    background: #1a1a1a;
    border: 1px solid #444;
    color: #ccc;
    font: 300 12px 'Roboto', sans-serif;
    padding: 4px 4px;
    width: 28px;
    text-align: center;
    outline: none;
}
.etr-colon { color: #888; font-size: 12px; }
.etr-tz { color: #999; font-size: 11px; margin-left: 4px; }
.etr-footer {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 12px 16px 14px;
    background: #222;
}
.etr-btn {
    background: #333;
    color: #999;
    border: none;
    padding: 5px 28px;
    font: 300 12px 'Roboto', sans-serif;
    border-radius: 12px;
    cursor: pointer;
}
.etr-btn:hover { background: #4a4a4a; color: #fff; }

.console-scroll-area {
    flex: 1;
    overflow-y: auto;
    background: #1a1a1a;
}
.console-alarms {
    padding: 0;
}
.console-alarms-scroll {
    flex: 1;
    overflow-y: auto;
    background: #1a1a1a;
    min-height: 0;
}

.alarm-entry {
    display: flex;
    flex-direction: column;
    padding: 8px 12px;
    border-bottom: 1px solid #222;
    font-size: 11px;
    cursor: pointer;
    transition: background 0.1s;
}

.alarm-entry:hover {
    background: rgba(255,255,255,0.02);
}

.alarm-entry-top {
    display: flex;
    align-items: center;
    gap: 6px;
}

.alarm-severity-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.alarm-timestamp {
    color: #777;
    font-size: 11px;
    font-weight: 400;
}

.alarm-entry-body {
    color: #999;
    font-size: 11px;
    font-weight: 400;
    padding-left: 22px;
    padding-top: 3px;
    line-height: 1.5;
    word-wrap: break-word;
}

.alarm-entry-body .alarm-severity-label {
    font-style: italic;
}

.alarm-entry-body .alarm-priority {
    color: #666;
    font-style: italic;
}

.alarm-entry.acked {
    opacity: 0.4;
}

.alarm-checkbox {
    width: 13px;
    height: 13px;
    accent-color: #4fc3f7;
    flex-shrink: 0;
}

.console-buttons {
    display: grid;
    grid-template-columns: repeat(3, 150px);
    justify-content: center;
    gap: 6px 8px;
    padding: 12px 20px;
    background: #1a1a1a;
}
.console-buttons .console-btn:nth-child(7) {
    grid-column: span 2;
}


.console-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    background: #333;
    border: none;
    border-radius: 14px;
    color: #999;
    font-family: 'Roboto', sans-serif;
    font-size: 12px;
    font-weight: 400;
    padding: 6px 12px;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.btn-icon {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
    opacity: 0.7;
}

.console-btn:hover {
    background: #3a3a3a;
    color: #bbb;
}

/* footer-line not used - line is now ::after on breadcrumb */
#footer-line {
    display: none;
}

/* ============================================
   SCROLLBAR (ciemny styl SCADA)
   ============================================ */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #262626;
}

::-webkit-scrollbar-thumb {
    background: #3a3a3e;
    border-radius: 0;
}

::-webkit-scrollbar-thumb:hover {
    background: #4a4a4e;
}
