        * { margin: 0; padding: 0; box-sizing: border-box; }

        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background: radial-gradient(1200px 600px at 20% 10%, rgba(0,255,255,0.08), transparent),
                        radial-gradient(1200px 600px at 80% 90%, rgba(255,0,255,0.08), transparent),
                        #0b1020;
            color: #c9d1d9;
            padding: 12px;
            font-size: 14px;
        }

        .grid-overlay {
            position: fixed;
            inset: 0;
            pointer-events: none;
            background-image: linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
                              linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
            background-size: 24px 24px;
        }

        .container {
            max-width: 1232px;
            margin: 0 auto;
            background: rgba(12, 18, 40, 0.8);
            border: 1px solid rgba(0, 255, 255, 0.2);
            border-radius: 12px;
            box-shadow: 0 0 32px rgba(0, 255, 255, 0.1), inset 0 0 28px rgba(0, 0, 0, 0.4);
            backdrop-filter: blur(8px);
            overflow: hidden;
            transition: margin-left 0.28s cubic-bezier(0.22, 1, 0.36, 1);
        }

        .container.monitor-floating {
            position: fixed;
            left: 84px;
            top: 14px;
            margin: 0 !important;
            width: min(1232px, calc(100vw - 98px));
            height: calc(100vh - 28px);
            max-width: calc(100vw - 98px);
            max-height: calc(100vh - 28px);
            min-width: 640px;
            min-height: 280px;
            z-index: 10030;
            resize: both;
            display: flex;
            flex-direction: column;
            transform: translateX(0);
            transition: transform 0.52s cubic-bezier(0.16, 1, 0.3, 1), width 0.28s cubic-bezier(0.22, 1, 0.36, 1), max-width 0.28s cubic-bezier(0.22, 1, 0.36, 1);
        }

        /* When settings sub-sidebar is open, shift content right by sidebar width + 5% */
        body.settings-subsidebar-open > .container {
            margin-left: 144px !important;
        }
        body.settings-subsidebar-open .container.monitor-floating {
            transform: translateX(calc(72px + 5%));
            width: min(1232px, calc(100vw - 170px));
            max-width: calc(100vw - 170px);
        }

        .container.monitor-floating #content {
            flex: 1 1 auto;
            min-height: 0;
            overflow: hidden;
        }

        .container.monitor-floating.minimized {
            height: 58px;
            min-height: 58px;
            resize: none;
        }

        .container.monitor-floating.minimized .metadata,
        .container.monitor-floating.minimized #content {
            display: none;
        }

        .monitor-window-controls {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            margin-left: 10px;
        }

        .monitor-window-btn {
            width: 30px;
            height: 30px;
            border: 1px solid rgba(0, 255, 255, 0.35);
            background: rgba(0, 255, 255, 0.1);
            color: #7dd3fc;
            border-radius: 6px;
            cursor: pointer;
            font-size: 14px;
            font-weight: 700;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            line-height: 1;
        }

        .monitor-window-btn:hover {
            background: rgba(0, 255, 255, 0.2);
        }

        .monitor-drag-handle {
            width: 30px;
            height: 30px;
            border: 1px solid rgba(0, 255, 255, 0.35);
            border-radius: 6px;
            color: #7dd3fc;
            background: rgba(0, 255, 255, 0.08);
            display: inline-flex;
            align-items: center;
            justify-content: center;
            cursor: move;
            user-select: none;
            font-size: 13px;
            letter-spacing: 0;
        }

        .header {
            background: linear-gradient(135deg, rgba(125, 211, 252, 0.36), rgba(34, 211, 238, 0.3));
            color: #e6edf3;
            padding: 16px;
            text-align: center;
            display: flex;
            flex-direction: column;
            align-items: center;
            border-bottom: 1px solid rgba(0,255,255,0.2);
        }

        .header-top {
            display: flex;
            justify-content: space-between;
            align-items: center;
            width: 100%;
            margin-bottom: 8px;
        }

        .header-main {
            display: flex;
            align-items: center;
            gap: 14px;
            margin-bottom: 10px;
        }

        .header .logo {
            max-width: 360px;
            height: auto;
            padding: 15px 24px;
            background: rgba(255, 255, 255, 0.12);
            border-radius: 12px;
            filter: drop-shadow(0 0 12px rgba(0,255,255,0.18));
        }
        .header-brand {
            display: flex;
            align-items: center;
            gap: 12px;
            flex-wrap: wrap;
        }
        .farm-name-next-logo {
            display: inline-flex;
            align-items: center;
            gap: 10px;
            padding: 15px 24px;
            min-height: 62px;
            border-radius: 12px;
            border: 1px solid rgba(255, 255, 255, 0.14);
            background: rgba(255, 255, 255, 0.12);
            color: #e6edf3;
            font-size: 18px;
            font-weight: 800;
            letter-spacing: 0.5px;
            box-shadow: 0 0 14px rgba(0, 255, 255, 0.18);
            white-space: nowrap;
        }
        .farm-name-next-logo .farm-name-text {
            display: inline-block;
            line-height: 1;
        }
        .farm-name-next-logo .farm-icon {
            width: 28px;
            height: 28px;
            object-fit: contain;
            filter: drop-shadow(0 0 7px rgba(34, 211, 238, 0.28));
            flex: 0 0 auto;
        }
        .header h1 { font-size: 1.9em; margin-bottom: 8px; letter-spacing: 0.4px; text-align: left; }
        .header p { opacity: 0.8; font-size: 0.96em; margin: 0; text-align: left; }

        .avg-metrics-row {
            width: 100%;
            margin-top: 8px;
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 8px;
            flex-wrap: wrap;
        }

        .avg-chip {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            padding: 5px 10px;
            border-radius: 999px;
            border: 1px solid rgba(125, 211, 252, 0.28);
            background: linear-gradient(135deg, rgba(30, 41, 59, 0.86), rgba(15, 23, 42, 0.86));
            min-height: 30px;
        }

        .avg-chip-label {
            color: #8cd8ff;
            font-size: 11px;
            font-weight: 600;
            line-height: 1;
            letter-spacing: 0.2px;
        }

        .avg-chip-value {
            min-width: 64px;
            padding: 2px 8px;
            border-radius: 999px;
            border: 1px solid rgba(34, 211, 238, 0.35);
            background: rgba(15, 118, 110, 0.18);
            color: #d9fbff;
            font-size: 11px;
            font-weight: 700;
            text-align: center;
            line-height: 1.2;
        }

        .avg-chip-value.empty {
            background: rgba(51, 65, 85, 0.22);
            border-color: rgba(125, 211, 252, 0.18);
            color: #9ca3af;
        }

        .map-status-legend {
            width: 100%;
            display: flex;
            align-items: center;
            gap: 10px;
            flex-wrap: wrap;
            margin-top: 4px;
            padding: 8px 10px;
            border-radius: 8px;
            border: 1px solid rgba(125, 211, 252, 0.28);
            background: linear-gradient(135deg, rgba(15, 23, 42, 0.72), rgba(30, 41, 59, 0.66));
        }

        .map-status-legend.is-hidden {
            display: none;
        }

        .map-status-legend-title {
            color: #7dd3fc;
            font-size: 12px;
            font-weight: 700;
            letter-spacing: 0.2px;
        }

        .map-status-legend-items {
            display: flex;
            align-items: center;
            gap: 8px;
            flex-wrap: wrap;
        }

        .map-status-legend-item {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 3px 8px;
            border-radius: 999px;
            border: 1px solid rgba(148, 163, 184, 0.35);
            background: rgba(15, 23, 42, 0.6);
            color: #d8e6f3;
            font-size: 11px;
            line-height: 1;
            white-space: nowrap;
        }

        .map-status-swatch {
            width: 13px;
            height: 13px;
            border-radius: 2px;
            border: 1px solid rgba(226, 232, 240, 0.65);
            box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.45);
            flex: 0 0 auto;
            cursor: pointer;
        }

        .map-status-swatch.status-0 { background: rgba(128, 128, 128, 0.5); }
        .map-status-swatch.status-1 { background: #f7a8b8; }
        .map-status-swatch.status-2 { background: rgba(38, 132, 255, 0.5); }
        .map-status-swatch.status-3 { background: rgba(255, 235, 140, 0.5); }
        .map-status-swatch.status-4 { background: rgba(255, 160, 160, 0.4); }
        .map-status-swatch.status-5 { background: rgba(152, 217, 166, 0.75); }
        .map-status-swatch.status-6 { background: rgba(255, 136, 0, 0.75); }

        .map-label-controls {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            flex-wrap: wrap;
        }

        .floating-map-legend .map-status-legend-items {
            flex: 1 1 auto;
            min-width: 0;
        }

        .floating-map-legend .map-label-controls {
            margin-left: auto;
            justify-content: flex-end;
        }

        .map-label-control {
            display: inline-flex;
            align-items: center;
            gap: 5px;
            padding: 3px 8px;
            border-radius: 999px;
            border: 1px solid rgba(148, 163, 184, 0.35);
            background: rgba(15, 23, 42, 0.6);
            color: #d8e6f3;
            font-size: 11px;
            line-height: 1;
            white-space: nowrap;
            user-select: none;
        }

        .map-label-control input {
            width: 13px;
            height: 13px;
            accent-color: #38bdf8;
        }

        .map-weather-run-btn {
            border: 1px solid rgba(56, 189, 248, 0.5);
            border-radius: 999px;
            background: rgba(14, 116, 144, 0.32);
            color: #d8f3ff;
            font-size: 11px;
            font-weight: 700;
            padding: 5px 10px;
            cursor: pointer;
            line-height: 1;
        }

        .map-weather-run-btn:hover {
            background: rgba(2, 132, 199, 0.4);
        }

        .map-weather-run-btn:disabled {
            opacity: 0.6;
            cursor: wait;
        }

        .status {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            background: rgba(0, 255, 180, 0.15);
            padding: 5px 12px;
            border-radius: 22px;
            font-size: 0.88em;
            margin-top: 10px;
            border: 1px solid rgba(0,255,180,0.3);
            color: #00ffc8;
        }
        .status::before {
            content: '';
            width: 10px; height: 10px; border-radius: 50%;
            background: #00ffc8; box-shadow: 0 0 10px #00ffc8;
            animation: pulse 2s infinite ease-in-out;
        }
        .status.offline { background: rgba(255, 64, 64, 0.12); color: #ff8080; border-color: rgba(255,64,64,0.3); }
        .status.offline::before { background: #ff5a5a; box-shadow: 0 0 10px #ff5a5a; }
        .farm-loading-indicator {
            display: none;
            align-items: center;
            gap: 7px;
            background: rgba(245, 158, 11, 0.16);
            color: #fcd34d;
            border: 1px solid rgba(245, 158, 11, 0.45);
            border-radius: 999px;
            padding: 5px 11px;
            font-size: 0.82em;
            white-space: nowrap;
        }
        .farm-loading-indicator::before {
            content: '';
            width: 9px;
            height: 9px;
            border-radius: 50%;
            background: #f59e0b;
            box-shadow: 0 0 8px rgba(245, 158, 11, 0.9);
            animation: pulse 1.4s infinite ease-in-out;
        }
        @keyframes pulse { 0% { transform: scale(1); opacity: 1;} 50% { transform: scale(1.4); opacity: 0.7;} 100% { transform: scale(1); opacity: 1;} }

        .metadata {
            background: rgba(12, 18, 40, 0.7);
            padding: 8px 16px;
            display: flex; justify-content: space-between; flex-wrap: wrap;
            border-bottom: 1px solid rgba(0,255,255,0.15);
        }
        .metadata-item { margin: 3px 6px; font-size: 0.9em; }
        .metadata-item strong { color: #7dd3fc; }
        .metadata.frozen {
            opacity: 0.78;
        }
        .metadata-action-btn {
            margin-left: 8px;
            padding: 3px 8px;
            border-radius: 6px;
            border: 1px solid rgba(0, 255, 255, 0.35);
            background: rgba(0, 255, 255, 0.08);
            color: #7dd3fc;
            cursor: pointer;
            font-size: 0.78em;
            font-weight: 600;
            transition: all 0.2s ease;
        }
        .metadata-action-btn:hover {
            background: rgba(0, 255, 255, 0.18);
            box-shadow: 0 0 10px rgba(0, 255, 255, 0.18);
        }

        .ai-assistant-panel {
            margin: 14px 12px 0;
            border: 1px solid rgba(125, 211, 252, 0.24);
            border-radius: 14px;
            background: linear-gradient(145deg, rgba(8, 18, 34, 0.94), rgba(10, 28, 44, 0.82));
            box-shadow: 0 18px 38px rgba(2, 8, 24, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.04);
            overflow: hidden;
        }

        .ai-assistant-header {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 12px;
            padding: 14px 16px 10px;
            border-bottom: 1px solid rgba(125, 211, 252, 0.14);
            background: linear-gradient(90deg, rgba(0, 255, 200, 0.07), rgba(125, 211, 252, 0.06));
        }

        .ai-assistant-header-left {
            display: flex;
            align-items: flex-start;
            gap: 10px;
            min-width: 0;
        }

        .ai-assistant-toggle {
            width: 63px;
            height: 63px;
            border-radius: 12px;
            border: 1px solid rgba(125, 211, 252, 0.28);
            background: rgba(15, 23, 42, 0.62);
            display: inline-flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            flex-shrink: 0;
            overflow: hidden;
            padding: 6px;
            transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
        }

        .ai-assistant-toggle img {
            width: 100%;
            height: 100%;
            object-fit: contain;
            display: block;
        }

        .ai-assistant-toggle:hover {
            background: rgba(30, 41, 59, 0.84);
            border-color: rgba(125, 211, 252, 0.45);
        }

        .ai-assistant-toggle:focus-visible {
            outline: none;
            box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.16);
            border-color: rgba(34, 211, 238, 0.72);
        }

        .ai-assistant-title {
            font-size: 1rem;
            font-weight: 800;
            color: #e6edf3;
            letter-spacing: 0.02em;
        }

        .ai-assistant-hint {
            margin-top: 4px;
            color: #9fb8ce;
            font-size: 0.88rem;
            line-height: 1.4;
        }

        .ai-assistant-status {
            align-self: center;
            padding: 6px 10px;
            border-radius: 999px;
            border: 1px solid rgba(125, 211, 252, 0.2);
            background: rgba(15, 23, 42, 0.62);
            color: #cfe8f8;
            font-size: 0.78rem;
            white-space: nowrap;
        }

        .ai-assistant-status.success {
            color: #86efac;
            border-color: rgba(134, 239, 172, 0.24);
            background: rgba(20, 83, 45, 0.22);
        }

        .ai-assistant-status.success-llm {
            color: #86efac;
            border-color: rgba(134, 239, 172, 0.24);
            background: rgba(20, 83, 45, 0.22);
        }

        .ai-assistant-status.success-partial {
            color: #fdba74;
            border-color: rgba(251, 146, 60, 0.32);
            background: rgba(124, 45, 18, 0.24);
        }

        .ai-assistant-status.success-deterministic {
            color: #fde68a;
            border-color: rgba(250, 204, 21, 0.3);
            background: rgba(113, 63, 18, 0.24);
        }

        .ai-assistant-status.error {
            color: #fda4af;
            border-color: rgba(251, 113, 133, 0.28);
            background: rgba(76, 5, 25, 0.26);
        }

        .ai-assistant-status.working {
            color: #7dd3fc;
            border-color: rgba(125, 211, 252, 0.3);
            background: rgba(8, 47, 73, 0.28);
        }

        .ai-assistant-body {
            display: grid;
            gap: 12px;
            padding: 14px 16px 16px;
        }

        .ai-assistant-panel.collapsed .ai-assistant-body {
            display: none;
        }

        .ai-assistant-question {
            width: 100%;
            min-height: 88px;
            resize: vertical;
            border-radius: 12px;
            border: 1px solid rgba(125, 211, 252, 0.22);
            background: rgba(15, 23, 42, 0.72);
            color: #e6edf3;
            padding: 12px 14px;
            font: inherit;
            line-height: 1.45;
        }

        .ai-assistant-question:focus {
            outline: none;
            border-color: rgba(34, 211, 238, 0.68);
            box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.12);
        }

        .ai-assistant-suggestions {
            display: grid;
            gap: 6px;
            min-width: 260px;
        }

        .ai-assistant-suggestions-label {
            color: #9fb8ce;
            font-size: 0.75rem;
            letter-spacing: 0.02em;
            text-transform: uppercase;
        }

        .ai-assistant-suggestions-label-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
        }

        .ai-assistant-help-btn {
            border: 1px solid rgba(125, 211, 252, 0.28);
            background: rgba(15, 23, 42, 0.88);
            color: #7dd3fc;
            min-width: 30px;
            height: 30px;
            border-radius: 999px;
            font-size: 0.98rem;
            font-weight: 800;
            line-height: 1;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.16s ease;
        }

        .ai-assistant-help-btn:hover {
            color: #e6edf3;
            border-color: rgba(34, 211, 238, 0.58);
            background: rgba(12, 20, 34, 0.96);
            box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.12);
        }

        .ai-assistant-help-btn:focus-visible {
            outline: none;
            box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.2);
        }

        .ai-assistant-suggestions-row {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .ai-assistant-suggestion-select {
            flex: 0 1 320px;
            min-width: 190px;
            max-width: 420px;
            padding: 8px 10px;
            border-radius: 10px;
            border: 1px solid rgba(125, 211, 252, 0.24);
            background: rgba(15, 23, 42, 0.9);
            color: #dbeafe;
            font: inherit;
            font-size: 0.82rem;
        }

        .ai-assistant-suggestion-select:focus {
            outline: none;
            border-color: rgba(34, 211, 238, 0.68);
            box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.12);
        }

        .ai-assistant-actions {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            justify-content: flex-start;
            gap: 10px;
        }

        .ai-assistant-controls {
            display: flex;
            gap: 8px;
            align-items: center;
            flex-wrap: nowrap;
            width: 100%;
        }

        .ai-assistant-btn {
            padding: 9px 14px;
            border-radius: 10px;
            border: 1px solid rgba(125, 211, 252, 0.24);
            background: rgba(15, 23, 42, 0.9);
            color: #dbeafe;
            cursor: pointer;
            font-weight: 700;
            font-size: 0.85rem;
        }

        .ai-assistant-btn.primary {
            border: none;
            background: linear-gradient(135deg, #00ffc8 0%, #7dd3fc 100%);
            color: #0b1020;
        }

        .ai-assistant-btn.active {
            border-color: rgba(34, 211, 238, 0.72);
            background: rgba(10, 35, 56, 0.96);
            box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.12);
        }

        .ai-assistant-btn:disabled {
            opacity: 0.46;
            cursor: not-allowed;
        }

        .ai-assistant-response {
            border: 1px solid rgba(125, 211, 252, 0.18);
            border-radius: 12px;
            background: rgba(7, 14, 28, 0.76);
            padding: 14px;
            display: grid;
            gap: 10px;
        }

        .ai-assistant-response-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            flex-wrap: wrap;
        }

        .ai-assistant-response-title {
            font-size: 0.86rem;
            letter-spacing: 0.04em;
            text-transform: uppercase;
            color: #7dd3fc;
            font-weight: 800;
        }

        .ai-assistant-meta {
            color: #9fb8ce;
            font-size: 0.8rem;
        }

        .ai-assistant-answer {
            color: #e6edf3;
            line-height: 1.6;
            white-space: pre-wrap;
        }

        .ai-assistant-chart {
            display: none;
            border: 1px solid rgba(125, 211, 252, 0.16);
            border-radius: 10px;
            background: rgba(15, 23, 42, 0.72);
            padding: 10px;
            gap: 8px;
        }

        .ai-assistant-chart.show {
            display: grid;
        }

        .ai-assistant-chart-title {
            color: #7dd3fc;
            font-size: 0.8rem;
            font-weight: 800;
            text-transform: uppercase;
            letter-spacing: 0.04em;
        }

        .ai-assistant-chart-canvas-wrap {
            position: relative;
            min-height: 220px;
        }

        .ai-assistant-chart-note {
            color: #9fb8ce;
            font-size: 0.78rem;
        }

        .ai-assistant-table {
            display: none;
            border: 1px solid rgba(125, 211, 252, 0.16);
            border-radius: 10px;
            background: rgba(15, 23, 42, 0.72);
            padding: 10px;
            gap: 8px;
        }

        .ai-assistant-table.show {
            display: grid;
        }

        .ai-assistant-table-title {
            color: #7dd3fc;
            font-size: 0.8rem;
            font-weight: 800;
            text-transform: uppercase;
            letter-spacing: 0.04em;
        }

        .ai-assistant-table-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
            flex-wrap: wrap;
        }

        .ai-assistant-table-export-btn {
            border: 1px solid rgba(125, 211, 252, 0.3);
            background: rgba(7, 14, 28, 0.8);
            color: #dbeafe;
            border-radius: 8px;
            padding: 5px 9px;
            cursor: pointer;
            font-size: 0.72rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.03em;
        }

        .ai-assistant-table-export-btn:disabled {
            opacity: 0.45;
            cursor: not-allowed;
        }

        .ai-assistant-table-wrap {
            max-height: 300px;
            overflow: auto;
            border-radius: 8px;
            border: 1px solid rgba(125, 211, 252, 0.14);
        }

        .ai-assistant-table-grid {
            width: 100%;
            border-collapse: collapse;
            font-size: 0.78rem;
            color: #dbeafe;
        }

        .ai-assistant-table-grid th,
        .ai-assistant-table-grid td {
            padding: 6px 8px;
            border-bottom: 1px solid rgba(125, 211, 252, 0.12);
            text-align: left;
            vertical-align: top;
            white-space: nowrap;
        }

        .ai-assistant-table-grid th {
            position: sticky;
            top: 0;
            z-index: 1;
            background: rgba(8, 14, 28, 0.92);
            color: #7dd3fc;
        }

        .ai-assistant-table-note {
            color: #9fb8ce;
            font-size: 0.76rem;
        }

        .ai-helper-modal {
            position: fixed;
            inset: 0;
            background: rgba(4, 8, 20, 0.72);
            backdrop-filter: blur(4px);
            display: none;
            align-items: center;
            justify-content: center;
            z-index: 13000;
            padding: 18px;
        }

        .ai-helper-modal.show {
            display: flex;
        }

        .ai-helper-panel {
            width: min(980px, 96vw);
            max-height: 88vh;
            overflow: hidden;
            border-radius: 14px;
            border: 1px solid rgba(125, 211, 252, 0.28);
            background: linear-gradient(155deg, rgba(6, 12, 28, 0.98), rgba(8, 18, 38, 0.96));
            box-shadow: 0 30px 65px rgba(2, 8, 18, 0.6);
            display: grid;
            grid-template-rows: auto 1fr;
        }

        .ai-helper-header {
            padding: 14px 16px;
            border-bottom: 1px solid rgba(125, 211, 252, 0.18);
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            background: linear-gradient(120deg, rgba(125, 211, 252, 0.18), rgba(16, 185, 129, 0.1));
        }

        .ai-helper-title-wrap {
            display: grid;
            gap: 4px;
        }

        .ai-helper-title {
            color: #e6edf3;
            font-size: 1rem;
            font-weight: 800;
            letter-spacing: 0.02em;
        }

        .ai-helper-subtitle {
            color: #9fb8ce;
            font-size: 0.84rem;
        }

        .ai-helper-close {
            border: 1px solid rgba(125, 211, 252, 0.3);
            background: rgba(7, 14, 28, 0.8);
            color: #dbeafe;
            border-radius: 10px;
            width: 34px;
            height: 34px;
            cursor: pointer;
            font-size: 1.02rem;
            font-weight: 800;
        }

        .ai-helper-content {
            overflow: auto;
            padding: 14px;
            display: grid;
            gap: 12px;
        }

        .ai-helper-section {
            border: 1px solid rgba(125, 211, 252, 0.16);
            border-radius: 12px;
            background: rgba(8, 16, 30, 0.75);
            overflow: hidden;
        }

        .ai-helper-section-toggle {
            list-style: none;
            cursor: pointer;
            padding: 12px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
        }

        .ai-helper-section-toggle::-webkit-details-marker {
            display: none;
        }

        .ai-helper-section-toggle::after {
            content: '+';
            color: #9fb8ce;
            font-weight: 700;
            font-size: 0.95rem;
            line-height: 1;
        }

        .ai-helper-section[open] .ai-helper-section-toggle::after {
            content: '-';
        }

        .ai-helper-section-body {
            padding: 0 12px 12px;
            display: grid;
            gap: 8px;
        }

        .ai-helper-section-title {
            color: #7dd3fc;
            font-size: 0.84rem;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            font-weight: 800;
        }

        .ai-helper-section-count {
            color: #9fb8ce;
            font-size: 0.78rem;
            font-weight: 700;
            letter-spacing: 0.02em;
        }

        .ai-helper-question-list {
            margin: 0;
            padding-left: 16px;
            color: #dbeafe;
            display: grid;
            gap: 6px;
        }

        .ai-helper-question-item {
            cursor: pointer;
        }

        .ai-helper-question-item:hover > span {
            color: #67e8f9;
        }

        .ai-helper-empty {
            color: #9fb8ce;
            font-size: 0.84rem;
            padding: 6px 2px;
        }

        .growth-entry-modal {
            position: fixed;
            inset: 0;
            background: transparent;
            backdrop-filter: none;
            z-index: 12500;
            display: none;
            pointer-events: none;
            padding: 0;
        }

        .growth-entry-modal.show {
            display: block;
        }

        .growth-entry-panel {
            position: fixed;
            right: 20px;
            top: 110px;
            width: min(720px, calc(100vw - 40px));
            max-height: calc(100vh - 140px);
            overflow: hidden;
            border-radius: 16px;
            border: 1px solid rgba(125, 211, 252, 0.22);
            background: linear-gradient(160deg, rgba(6, 12, 28, 0.98), rgba(11, 20, 42, 0.96));
            box-shadow: 0 30px 65px rgba(2, 8, 18, 0.58);
            display: grid;
            grid-template-rows: auto auto 1fr auto;
            pointer-events: auto;
            resize: both;
        }

        .growth-entry-header {
            padding: 14px 16px;
            border-bottom: 1px solid rgba(125, 211, 252, 0.18);
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            background: linear-gradient(120deg, rgba(125, 211, 252, 0.16), rgba(42, 157, 143, 0.12));
            cursor: move;
            user-select: none;
        }

        .growth-entry-title-wrap {
            display: grid;
            gap: 4px;
        }

        .growth-entry-title {
            color: #e6edf3;
            font-size: 1rem;
            font-weight: 800;
            letter-spacing: 0.02em;
        }

        .growth-entry-subtitle {
            color: #9fb8ce;
            font-size: 0.84rem;
        }

        .growth-entry-close {
            border: 1px solid rgba(125, 211, 252, 0.3);
            background: rgba(7, 14, 28, 0.8);
            color: #dbeafe;
            border-radius: 10px;
            width: 34px;
            height: 34px;
            cursor: pointer;
            font-size: 1.02rem;
            font-weight: 800;
        }

        .growth-entry-status {
            padding: 10px 16px 0;
            color: #9fb8ce;
            font-size: 0.84rem;
            min-height: 34px;
        }

        .growth-entry-status.error {
            color: #fca5a5;
        }

        .growth-entry-status.ok {
            color: #86efac;
        }

        .growth-entry-body {
            overflow: auto;
            padding: 14px 16px 16px;
        }

        .growth-entry-note {
            border: 1px solid rgba(125, 211, 252, 0.14);
            border-radius: 12px;
            background: rgba(8, 16, 30, 0.72);
            color: #b7cae0;
            font-size: 0.82rem;
            line-height: 1.45;
            padding: 10px 12px;
            margin-bottom: 12px;
        }

        .growth-entry-grid {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 10px 12px;
        }

        .growth-entry-inline-row {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 10px 12px;
            grid-column: 1 / -1;
        }

        @media (max-width: 700px) {
            .growth-entry-inline-row {
                grid-template-columns: 1fr;
            }
        }

        .growth-entry-field {
            display: grid;
            gap: 5px;
        }

        .growth-entry-field.wide {
            grid-column: 1 / -1;
        }

        .growth-entry-label {
            color: #9fb8ce;
            font-size: 0.76rem;
            font-weight: 700;
            letter-spacing: 0.04em;
            text-transform: uppercase;
        }

        .growth-entry-input,
        .growth-entry-select {
            width: 100%;
            padding: 9px 11px;
            border-radius: 10px;
            border: 1px solid rgba(125, 211, 252, 0.24);
            background: rgba(15, 23, 42, 0.92);
            color: #dbeafe;
            font: inherit;
            font-size: 0.88rem;
        }

        .growth-entry-input:focus,
        .growth-entry-select:focus {
            outline: none;
            border-color: rgba(34, 211, 238, 0.7);
            box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.12);
        }

        .growth-entry-input[readonly] {
            color: #b7cae0;
            background: rgba(8, 16, 30, 0.88);
        }

        .growth-entry-date-wrap {
            display: grid;
            grid-template-columns: 1fr auto;
            gap: 8px;
            align-items: center;
        }

        .growth-entry-date-picker-btn {
            width: 42px;
            height: 42px;
            border-radius: 10px;
            border: 1px solid rgba(125, 211, 252, 0.24);
            background: rgba(15, 23, 42, 0.9);
            color: #dbeafe;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-size: 1rem;
            line-height: 1;
        }

        .growth-entry-date-picker-btn:hover {
            border-color: rgba(34, 211, 238, 0.56);
            background: rgba(19, 30, 51, 0.96);
        }

        .growth-entry-date-picker-btn:focus-visible {
            outline: none;
            box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.12);
        }

        .growth-entry-help {
            color: #9fb8ce;
            font-size: 0.76rem;
            min-height: 16px;
        }

        .growth-entry-actions {
            padding: 0 16px 16px;
            display: flex;
            gap: 10px;
            flex-wrap: wrap;
            align-items: center;
            justify-content: flex-end;
        }

        .growth-entry-btn {
            border: 1px solid rgba(125, 211, 252, 0.24);
            background: rgba(15, 23, 42, 0.9);
            color: #dbeafe;
            border-radius: 10px;
            padding: 9px 14px;
            cursor: pointer;
            font-weight: 700;
            font-size: 0.86rem;
        }

        .growth-entry-btn.primary {
            border: none;
            background: linear-gradient(135deg, #00ffc8 0%, #7dd3fc 100%);
            color: #0b1020;
        }

        .growth-entry-btn:disabled {
            opacity: 0.55;
            cursor: not-allowed;
        }

        .do-chart-modal {
            position: fixed;
            inset: 0;
            background: rgba(4, 8, 20, 0.62);
            backdrop-filter: blur(3px);
            z-index: 12000;
            display: none;
            align-items: center;
            justify-content: center;
            padding: 16px;
        }
        .do-chart-modal.show {
            display: flex;
        }
        .do-chart-panel {
            width: min(860px, 96vw);
            min-height: 420px;
            background: rgba(10, 18, 42, 0.96);
            border: 1px solid rgba(0, 255, 255, 0.3);
            border-radius: 12px;
            box-shadow: 0 0 38px rgba(0, 255, 255, 0.2);
            overflow: hidden;
        }
        .do-chart-header {
            height: 52px;
            padding: 0 14px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            background: linear-gradient(135deg, rgba(125, 211, 252, 0.36), rgba(34, 211, 238, 0.3));
            border-bottom: 1px solid rgba(0, 255, 255, 0.2);
            color: #e6edf3;
            font-weight: 600;
        }
        .do-chart-body {
            padding: 14px;
            height: 360px;
        }
        .do-chart-controls {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            margin-bottom: 8px;
            flex-wrap: wrap;
        }
        .do-chart-controls label {
            color: #9ad3e7;
            font-size: 0.9em;
            font-weight: 600;
        }
        .do-chart-controls select {
            padding: 4px 8px;
            background: rgba(30, 41, 59, 0.85);
            border: 1px solid rgba(0, 255, 255, 0.3);
            border-radius: 6px;
            color: #e6edf3;
            font-size: 0.88em;
        }
        #doChartStatus {
            color: #9ad3e7;
            font-size: 0.9em;
            margin-bottom: 8px;
        }

        .section { padding: 10px 16px; border-bottom: 1px dashed rgba(125, 211, 252, 0.2); }
        .section:last-child { border-bottom: none; }
        .section-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
        .section-title { font-size: 0.95em; color: #7dd3fc; display: flex; align-items: center; letter-spacing: 0.3px; }
        .section-title::before { content: ''; width: 4px; height: 24px; background: linear-gradient(180deg, #00ffc8, #7dd3fc); margin-right: 10px; box-shadow: 0 0 12px rgba(125,211,252,0.4); }
        .section-toggle { min-width: 28px; height: 28px; border-radius: 8px; border: 1px solid rgba(125,211,252,0.35); background: rgba(255,255,255,0.05); color: #e6edf3; cursor: pointer; font-weight: 700; }
        .section-toggle:hover { background: rgba(125,211,252,0.1); }
        .section-header-summary {
            display: none;
            margin-left: 8px;
            font-size: 0.95em;
            color: #00ffc8;
            font-weight: 600;
            padding: 4px 8px;
            background: rgba(0,255,200,0.1);
            border-radius: 6px;
            border: 1px solid rgba(0,255,200,0.2);
        }
        .section-header-summary.visible {
            display: inline-block;
        }
        .section.collapsed .section-header-summary {
            display: inline-block;
        }
        .section-body {
            position: relative;
            overflow: hidden;
            max-height: 2000px;
            opacity: 1;
            transition: max-height 0.65s ease, opacity 0.45s ease;
        }
        .schedule-running-day-block {
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 8px 0 14px;
            padding: 14px 18px;
            border-radius: 12px;
            border: 1px solid rgba(125,211,252,0.35);
            background: linear-gradient(135deg, rgba(125,211,252,0.18), rgba(14,165,233,0.1));
            box-shadow: 0 10px 28px rgba(8, 28, 49, 0.28), inset 0 0 18px rgba(125,211,252,0.08);
        }
        .schedule-running-day-value {
            font-size: 2.2em;
            font-weight: 700;
            color: #e6edf3;
            line-height: 1;
            letter-spacing: 0.02em;
            text-shadow: 0 0 12px rgba(125,211,252,0.28);
        }
        .section-body::after {
            content: '';
            position: absolute;
            inset: 0;
            pointer-events: none;
            background: repeating-linear-gradient(
                to bottom,
                rgba(255,255,255,0.35) 0px,
                rgba(255,255,255,0.35) 6px,
                rgba(255,255,255,0) 6px,
                rgba(255,255,255,0) 12px
            );
            background-size: 100% 12px;
            opacity: 0;
            transform: translateY(-10px);
            mix-blend-mode: soft-light;
        }
        .section.collapsed .section-body {
            max-height: 0;
            opacity: 0;
            pointer-events: none;
        }
        .section.collapsed .section-body::after {
            animation: blinds-close 0.9s ease-in-out;
        }
        .section:not(.collapsed) .section-body::after {
            animation: blinds-open 0.9s ease-in-out;
        }
        .section.disabled {
            border-bottom-style: solid;
            border-bottom-color: rgba(148, 163, 184, 0.18);
            opacity: 0.78;
        }
        .section.disabled .section-title {
            color: #9ca3af;
        }
        .section.disabled .section-title::before {
            background: linear-gradient(180deg, #64748b, #94a3b8);
            box-shadow: 0 0 10px rgba(148, 163, 184, 0.25);
        }
        .section-disabled-message {
            margin-top: 6px;
            padding: 12px 14px;
            border-radius: 8px;
            border: 1px dashed rgba(148, 163, 184, 0.28);
            background: rgba(51, 65, 85, 0.18);
            color: #cbd5e1;
            font-size: 0.9em;
            letter-spacing: 0.2px;
        }
        .status-badge.status-ssr {
            background: rgba(0, 255, 136, 0.12);
            color: #00ff88;
            border-color: rgba(0, 255, 136, 0.3);
        }

        @keyframes blinds-open {
            0% { opacity: 0; transform: translateY(-12px); background-position: 0 -12px; }
            50% { opacity: 0.35; transform: translateY(-4px); background-position: 0 -6px; }
            100% { opacity: 0; transform: translateY(0); background-position: 0 0; }
        }
        @keyframes blinds-close {
            0% { opacity: 0; transform: translateY(0); background-position: 0 0; }
            50% { opacity: 0.35; transform: translateY(-6px); background-position: 0 -6px; }
            100% { opacity: 0; transform: translateY(-12px); background-position: 0 -12px; }
        }

        .grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px; margin-top: 6px; }
        .metric { background: rgba(255,255,255,0.04); padding: 8px 10px; border-radius: 7px; border: 1px solid rgba(125,211,252,0.15); box-shadow: inset 0 0 20px rgba(0,0,0,0.35); }
        .metric-label { font-size: 0.72em; color: #8b9fb3; margin-bottom: 3px; display: flex; align-items: center; gap: 4px; }
        .metric-value { font-size: 1.25em; font-weight: 700; color: #e6edf3; text-shadow: 0 0 8px rgba(125,211,252,0.2); }

        /* Compact styling for solar card */
        .solar-compact .section-body { padding: 8px 10px; }
        .solar-compact .grid { gap: 6px; }
        .solar-compact .metric { padding: 6px 8px; }
        .solar-compact .metric-value { font-size: 1.05em; }
        .solar-compact canvas#solarLine { height: 50px; }

        /* Compact styling for energy, water, environment */
        .energy-compact .section-body,
        .water-compact .section-body,
        .env-compact .section-body { padding: 8px 10px; }

        .energy-compact .grid,
        .water-compact .grid,
        .env-compact .grid { gap: 6px; }

        .energy-compact .metric,
        .water-compact .metric,
        .env-compact .metric { padding: 6px 8px; }

        .energy-compact .metric-value,
        .water-compact .metric-value,
        .env-compact .metric-value { font-size: 1.05em; }

        .energy-compact canvas#energyLine,
        .water-compact canvas#waterLine,
        .env-compact canvas#envLine { height: 50px; }
        .metric-unit { font-size: 0.85em; color: #7f8c9f; margin-left: 6px; }

        .status-badge { display: inline-block; padding: 3px 9px; border-radius: 11px; font-size: 0.72em; margin-left: 8px; border: 1px solid rgba(255,255,255,0.15); }

        /* Alarm nav badge */
        #nav-alarms { position: relative; }
        .alarm-badge {
            display: none;
            position: absolute;
            top: 4px; right: 6px;
            min-width: 18px; height: 18px;
            padding: 0 5px;
            background: #ff4444;
            color: #fff;
            font-size: 11px;
            font-weight: 700;
            border-radius: 9px;
            line-height: 18px;
            text-align: center;
            pointer-events: none;
            z-index: 10;
        }
        .alarm-badge.visible { display: block; }
        /* Silent-units table */
        .alarm-table { width: 100%; border-collapse: collapse; margin-top: 16px; font-size: 0.9em; }
        .alarm-table th { text-align: left; padding: 8px 12px; border-bottom: 1px solid rgba(125,211,252,0.2); color: #7dd3fc; }
        .alarm-table td { padding: 8px 12px; border-bottom: 1px solid rgba(255,255,255,0.05); }
        .alarm-table tr:hover td { background: rgba(255,255,255,0.04); }
        .alarm-actions { display: flex; justify-content: flex-end; margin-top: 12px; }
        .alarm-erase-btn {
            padding: 6px 12px;
            border-radius: 6px;
            border: 1px solid rgba(255, 85, 85, 0.45);
            background: rgba(255, 85, 85, 0.12);
            color: #ff9c9c;
            font-size: 0.78em;
            font-weight: 700;
            letter-spacing: 0.2px;
            cursor: pointer;
            text-transform: uppercase;
        }
        .alarm-erase-btn:hover {
            background: rgba(255, 85, 85, 0.22);
            box-shadow: 0 0 10px rgba(255, 85, 85, 0.2);
        }
        .status-good { background: rgba(0,255,200,0.12); color: #00ffc8; }
        .status-warning { background: rgba(255,196,0,0.12); color: #ffc400; }
        .status-alert { background: rgba(255,64,64,0.12); color: #ff8080; }

        .progress-bar { width: 100%; height: 20px; background: rgba(255,255,255,0.06); border: 1px solid rgba(125,211,252,0.15); border-radius: 11px; overflow: hidden; margin-top: 7px; }
        .progress-fill { height: 100%; background: linear-gradient(90deg, #00ffc8 0%, #7dd3fc 100%); transition: width 0.5s ease; display: flex; align-items: center; justify-content: center; color: #0b1020; font-size: 0.75em; font-weight: 700; text-shadow: none; }

        .dial {
            position: relative;
            width: 120px;
            height: 120px;
            margin: 6px auto;
            --fill: 50;
        }
        .dial::before {
            content: '';
            position: absolute;
            inset: 10px;
            border-radius: 50%;
            background: conic-gradient(rgba(255,255,255,0.12) 0deg, rgba(255,255,255,0.12) 360deg);
            mask: radial-gradient(farthest-side, transparent 62%, #000 63%);
            -webkit-mask: radial-gradient(farthest-side, transparent 62%, #000 63%);
        }
        .dial-arc {
            position: absolute;
            inset: 10px;
            border-radius: 50%;
            background: conic-gradient(#00ffc8 calc(var(--fill) * 1%), rgba(255,255,255,0.04) 0deg);
            box-shadow: inset 0 0 18px rgba(0,0,0,0.45), 0 0 18px rgba(0,255,200,0.15);
            mask: radial-gradient(farthest-side, transparent 62%, #000 63%);
            -webkit-mask: radial-gradient(farthest-side, transparent 62%, #000 63%);
        }
        .dial-needle { display: none; }
        .dial-center {
            position: absolute;
            inset: 34px;
            border-radius: 10px;
            background: rgba(12, 18, 40, 0.9);
            border: 1px solid rgba(125,211,252,0.25);
            display: flex;
            align-items: center;
            justify-content: center;
            color: #e6edf3;
            font-weight: 800;
            font-size: 0.9em;
            letter-spacing: 0.3px;
            box-shadow: 0 0 12px rgba(0,255,200,0.12);
        }
        .dial-label { text-align: center; font-size: 0.75em; color: #8b9fb3; margin-top: 4px; }

        .summary { background: linear-gradient(135deg, rgba(125,211,252,0.15), rgba(0,255,200,0.12)); color: #e6edf3; padding: 18px 20px; border-top: 1px solid rgba(0,255,255,0.15); }
        .summary h2 { margin-bottom: 10px; font-size: 1.05em; }
        .summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
        .summary-item { background: rgba(12, 18, 40, 0.6); padding: 12px; border-radius: 8px; border: 1px solid rgba(125,211,252,0.15); }

        /* Google Map in floating window */
        #mapContainer {
            width: 100%;
            height: 100%;
            border: none;
            border-radius: 0;
            overflow: hidden;
            background: rgba(12, 18, 40, 0.85);
            margin: 0;
            position: relative;
        }

        #googleMap {
            width: 100%;
            height: 100%;
        }

        .floating-map-window {
            position: fixed;
            bottom: 80px;
            right: 610px;
            width: 580px;
            height: 520px;
            min-width: 360px;
            min-height: 280px;
            max-width: calc(100vw - 90px);
            max-height: calc(100vh - 40px);
            background: #0b1020;
            border: 1px solid rgba(0, 255, 255, 0.3);
            border-radius: 12px;
            box-shadow: 0 0 40px rgba(0, 255, 255, 0.22);
            z-index: 9990;
            display: none;
            flex-direction: column;
            overflow: hidden;
            resize: both;
        }

        .floating-map-window.show {
            display: flex;
        }

        .floating-map-window.minimized {
            height: 50px;
            min-height: 50px;
            resize: none;
        }

        .floating-map-window.minimized .floating-map-content {
            display: none;
        }

        .floating-map-content {
            flex: 1;
            overflow: hidden;
            background: #0b1020;
        }

        .floating-map-legend {
            position: absolute;
            top: 10px;
            left: 10px;
            right: 10px;
            z-index: 2;
            display: flex;
            align-items: center;
            gap: 8px;
            flex-wrap: wrap;
            padding: 8px;
            border-radius: 8px;
            border: 1px solid rgba(125, 211, 252, 0.32);
            background: rgba(11, 16, 32, 0.82);
            backdrop-filter: blur(3px);
            pointer-events: none;
        }

        .floating-map-legend.is-hidden {
            display: none;
        }

        .floating-map-legend .map-status-legend-item,
        .floating-map-legend .map-status-swatch,
        .floating-map-legend .map-label-control,
        .floating-map-legend .map-label-control input,
        .floating-map-legend .map-weather-run-btn {
            pointer-events: auto;
        }

        .floating-map-window::after {
            content: '';
            position: absolute;
            right: 6px;
            bottom: 6px;
            width: 14px;
            height: 14px;
            background: linear-gradient(135deg, transparent 48%, rgba(0, 255, 255, 0.65) 48%, rgba(0, 255, 255, 0.65) 56%, transparent 56%);
            pointer-events: none;
            opacity: 0.9;
        }

        @keyframes progress {
            0% { width: 0%; }
            50% { width: 100%; }
            100% { width: 100%; }
        }

        .floating-window-title::before {
            content: '';
            width: 4px;
            height: 24px;
            background: linear-gradient(180deg, #00ffc8, #7dd3fc);
            margin-right: 10px;
            box-shadow: 0 0 12px rgba(125,211,252,0.4);
        }

        .flow-diagram { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; align-items: center; margin-top: 8px; }
        .flow-diagram.inactive { opacity: 0.3; }
        .node { background: rgba(255,255,255,0.05); border: 1px solid rgba(125,211,252,0.2); border-radius: 9px; padding: 8px; text-align: center; font-size: 0.94em; }
        .link { height: 2px; background: linear-gradient(90deg, transparent, #00ffc8, transparent); box-shadow: 0 0 12px rgba(0,255,200,0.25); animation: flow 2s linear infinite; }
        .link.reverse { animation-direction: reverse; }
        .link.idle { animation: none; background: #334155; box-shadow: none; opacity: 0.45; }
        .topology-mode-chip {
            display: inline-flex;
            align-items: center;
            border: 1px solid rgba(0, 255, 200, 0.35);
            border-radius: 999px;
            padding: 2px 10px;
            font-size: 0.78em;
            letter-spacing: 0.02em;
            color: #9fffe8;
            background: rgba(0, 255, 200, 0.1);
        }
        .topology-route {
            margin-top: 8px;
            color: #9fb3c8;
            font-size: 0.86em;
            text-align: right;
        }
        @keyframes flow { 0% { background-position: 0 0; } 100% { background-position: 240px 0; } }

        .footer { text-align: center; padding: 14px; background: rgba(12, 18, 40, 0.7); color: #8b9fb3; font-size: 0.9em; border-top: 1px solid rgba(0,255,255,0.15); }
        .no-data { text-align: center; padding: 50px; color: #7f8c9f; }

        .btn-mqtt-commands {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            padding: 8px 16px;
            background: linear-gradient(135deg, rgba(255, 165, 0, 0.2), rgba(255, 140, 0, 0.15));
            border: 1px solid rgba(255, 165, 0, 0.4);
            border-radius: 8px;
            color: #ffa500;
            text-decoration: none;
            cursor: pointer;
            font-weight: 600;
            font-size: 0.95em;
            transition: all 0.3s ease;
            text-transform: uppercase;
            letter-spacing: 0.3px;
        }

        .btn-mqtt-commands:hover {
            background: linear-gradient(135deg, rgba(255, 165, 0, 0.4), rgba(255, 140, 0, 0.35));
            border-color: rgba(255, 165, 0, 0.7);
            box-shadow: 0 0 16px rgba(255, 165, 0, 0.3);
            transform: translateY(-2px);
        }

        .sidebar {
            position: fixed;
            top: 0; left: 0; bottom: 0;
            width: 72px;
            background: linear-gradient(180deg, rgba(7, 12, 27, 0.98) 0%, rgba(15, 23, 42, 0.98) 100%);
            border-right: 1px solid rgba(125, 211, 252, 0.2);
            z-index: 100;
            display: flex;
            flex-direction: column;
            align-items: center;
            padding-top: 18px;
            box-shadow: 8px 0 26px rgba(2, 6, 23, 0.36);
            overflow-y: auto;
            overflow-x: hidden;
            scrollbar-width: thin;
        }
        .sidebar nav ul {
            list-style: none;
            padding: 4px 8px;
            margin: 0;
            width: 100%;
            display: flex;
            flex-direction: column;
            gap: 8px;
        }
        .sidebar nav ul li {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 5px;
            padding: 10px 4px;
            cursor: pointer;
            color: #9fb6c9;
            font-size: 1.2em;
            transition: background 0.18s, color 0.18s, box-shadow 0.18s;
            border-left: 0;
            border-radius: 10px;
            border: 1px solid transparent;
        }
        .sidebar nav ul li.active, .sidebar nav ul li:hover {
            background: rgba(125, 211, 252, 0.12);
            color: #e6edf3;
            border: 1px solid rgba(125, 211, 252, 0.35);
            box-shadow: inset 0 0 0 1px rgba(30, 64, 175, 0.2);
        }
        .sidebar .nav-icon {
            font-size: 1.35em;
            margin-bottom: 2px;
            filter: saturate(0.85);
        }
        .sidebar .nav-icon-img {
            width: 24px;
            height: 24px;
            object-fit: contain;
            filter: drop-shadow(0 0 4px rgba(34, 211, 238, 0.18));
            vertical-align: middle;
        }
        .sidebar .nav-label {
            font-size: 0.68em;
            letter-spacing: 0.24px;
            font-weight: 600;
        }
        .sidebar nav ul li.nav-template-entry {
            padding: 8px 4px;
            min-height: 38px;
        }
        .sidebar nav ul li.nav-template-entry .nav-label {
            display: block;
            max-width: 62px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        .sidebar nav ul li.nav-dropdown {
            align-items: stretch;
            padding: 0;
            border-radius: 10px;
        }
        .sidebar .nav-dropdown-header {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 5px;
            padding: 10px 4px;
            cursor: pointer;
            color: inherit;
            width: 100%;
            border: none;
            background: transparent;
            font: inherit;
            border-radius: 10px;
        }
        .sidebar .nav-dropdown-arrow {
            font-size: 0.75em;
            line-height: 1;
            color: #9fb6c9;
            margin-top: 2px;
            transition: transform 0.2s ease;
        }
        .sidebar .nav-dropdown.open .nav-dropdown-arrow {
            transform: rotate(180deg);
        }
        .sidebar .nav-dropdown-menu {
            display: none;
            width: calc(100% - 12px);
            margin: 4px auto 6px;
            background: rgba(15, 23, 42, 0.66);
            border: 1px solid rgba(148, 163, 184, 0.24);
            border-radius: 9px;
            padding: 5px;
        }
        .sidebar .nav-dropdown.open .nav-dropdown-menu {
            display: block;
        }

        /* Settings sub-sidebar (admin only) */
        .settings-subsidebar {
            position: fixed;
            top: 0;
            left: 72px;
            bottom: 0;
            width: 72px;
            background: linear-gradient(180deg, rgba(10, 16, 34, 0.98) 0%, rgba(18, 26, 48, 0.98) 100%);
            border-right: 1px solid rgba(125, 211, 252, 0.18);
            z-index: 10040;
            display: flex;
            flex-direction: column;
            align-items: center;
            padding-top: 18px;
            box-shadow: 8px 0 26px rgba(2, 6, 23, 0.28);
            overflow-y: auto;
            overflow-x: hidden;
            scrollbar-width: thin;
            opacity: 0;
            transform: translateX(-12px);
            visibility: hidden;
            pointer-events: none;
            will-change: opacity, transform;
            transition: opacity 0.28s cubic-bezier(0.22, 1, 0.36, 1), transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 0.28s;
        }
        .settings-subsidebar.open {
            opacity: 1;
            transform: translateX(0);
            visibility: visible;
            pointer-events: auto;
            transition-delay: 0s;
        }
        .settings-subsidebar nav ul {
            list-style: none;
            padding: 4px 8px;
            margin: 0;
            width: 100%;
            display: flex;
            flex-direction: column;
            gap: 8px;
        }
        .settings-subsidebar nav ul li {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 5px;
            padding: 10px 4px;
            cursor: pointer;
            color: #9fb6c9;
            font-size: 1.2em;
            transition: background 0.18s, color 0.18s, box-shadow 0.18s;
            border-radius: 10px;
            border: 1px solid transparent;
        }

        @media (prefers-reduced-motion: reduce) {
            .container,
            .container.monitor-floating,
            .settings-subsidebar {
                transition: none;
            }
        }
        .settings-subsidebar nav ul li.active,
        .settings-subsidebar nav ul li:hover {
            background: rgba(125, 211, 252, 0.12);
            color: #e6edf3;
            border: 1px solid rgba(125, 211, 252, 0.35);
            box-shadow: inset 0 0 0 1px rgba(30, 64, 175, 0.2);
        }
        .settings-subsidebar .nav-icon {
            font-size: 1.35em;
            margin-bottom: 2px;
            filter: saturate(0.85);
        }
        .settings-subsidebar .nav-icon-img {
            width: 24px;
            height: 24px;
            object-fit: contain;
            filter: drop-shadow(0 0 4px rgba(34, 211, 238, 0.18));
            vertical-align: middle;
        }
        .settings-subsidebar .nav-label {
            font-size: 0.68em;
            letter-spacing: 0.24px;
            font-weight: 600;
        }
        .settings-subsidebar nav ul li.nav-template-entry {
            padding: 8px 4px;
            min-height: 38px;
        }
        .settings-subsidebar nav ul li.nav-template-entry .nav-label {
            display: block;
            max-width: 62px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        .settings-subsidebar .alarm-badge {
            display: none;
            position: absolute;
            top: 4px; right: 6px;
            min-width: 18px; height: 18px;
            padding: 0 5px;
            background: #ff4444;
            color: #fff;
            font-size: 11px;
            font-weight: 700;
            border-radius: 9px;
            line-height: 18px;
            text-align: center;
            pointer-events: none;
            z-index: 10;
        }
        .settings-subsidebar .alarm-badge.visible { display: block; }
        #nav-settings.active {
            background: rgba(125, 211, 252, 0.18);
            color: #e6edf3;
            border: 1px solid rgba(125, 211, 252, 0.45);
        }

        /* Floating Commands Window */
        .floating-commands-window {
            position: fixed;
            bottom: 80px;
            right: 20px;
            width: 560px;
            height: 825px;
            min-width: 360px;
            min-height: 220px;
            max-width: calc(100vw - 90px);
            max-height: calc(100vh - 40px);
            background: #0b1020;
            border: 1px solid rgba(0, 255, 255, 0.3);
            border-radius: 12px;
            box-shadow: 0 0 40px rgba(0, 255, 255, 0.2);
            z-index: 10000;
            display: none;
            flex-direction: column;
            overflow: hidden;
            resize: both;
        }

        .floating-commands-window.show {
            display: flex;
        }

        .floating-alarms-window {
            position: fixed;
            bottom: 80px;
            right: 610px;
            width: 520px;
            height: 440px;
            min-width: 340px;
            min-height: 220px;
            max-width: calc(100vw - 90px);
            max-height: calc(100vh - 40px);
            background: #0b1020;
            border: 1px solid rgba(255, 128, 128, 0.35);
            border-radius: 12px;
            box-shadow: 0 0 40px rgba(255, 85, 85, 0.18);
            z-index: 10005;
            display: none;
            flex-direction: column;
            overflow: hidden;
            resize: both;
        }

        .floating-alarms-window.show {
            display: flex;
        }

        .floating-alarms-window.minimized {
            height: 50px;
            min-height: 50px;
            resize: none;
        }

        .floating-alarms-window.minimized .floating-window-content {
            display: none;
        }

        .floating-alarms-window .floating-window-content {
            overflow: auto;
            background: #0b1020;
        }

        .floating-auth-window {
            position: fixed;
            bottom: 80px;
            right: 1140px;
            width: 620px;
            height: 460px;
            min-width: 380px;
            min-height: 240px;
            max-width: calc(100vw - 90px);
            max-height: calc(100vh - 40px);
            background: #0b1020;
            border: 1px solid rgba(125, 211, 252, 0.35);
            border-radius: 12px;
            box-shadow: 0 0 40px rgba(125, 211, 252, 0.15);
            z-index: 10006;
            display: none;
            flex-direction: column;
            overflow: hidden;
            resize: both;
        }

        .floating-auth-window.show {
            display: flex;
        }

        .floating-auth-window.minimized {
            height: 50px;
            min-height: 50px;
            resize: none;
        }

        .floating-auth-window.minimized .floating-window-content {
            display: none;
        }

        .floating-commands-window.minimized {
            height: 50px;
            min-height: 50px;
            resize: none;
        }

        .floating-commands-window.minimized .floating-window-content {
            display: none;
        }

        .floating-window-header {
            background: linear-gradient(135deg, rgba(125, 211, 252, 0.36), rgba(34, 211, 238, 0.3));
            padding: 12px 16px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            border-bottom: 1px solid rgba(0, 255, 255, 0.2);
            cursor: move;
            user-select: none;
            flex-shrink: 0;
            height: 50px;
        }

        .floating-window-title {
            font-size: 16px;
            font-weight: 600;
            color: #e6edf3;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .floating-window-controls {
            display: flex;
            gap: 8px;
        }

        .floating-window-btn {
            width: 28px;
            height: 28px;
            border: 1px solid rgba(0, 255, 255, 0.3);
            background: rgba(0, 255, 255, 0.08);
            color: #7dd3fc;
            border-radius: 4px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 16px;
            transition: all 0.2s ease;
        }

        .floating-window-btn:hover {
            background: rgba(0, 255, 255, 0.18);
            box-shadow: 0 0 10px rgba(0, 255, 255, 0.18);
        }

        .floating-window-btn.close {
            background: rgba(255, 85, 85, 0.08);
            border-color: rgba(255, 85, 85, 0.3);
            color: #ff5555;
        }

        .floating-window-btn.close:hover {
            background: rgba(255, 85, 85, 0.18);
            box-shadow: 0 0 10px rgba(255, 85, 85, 0.18);
        }

        .floating-window-btn.alarm-header-text {
            width: auto;
            padding: 0 10px;
            font-size: 12px;
            font-weight: 700;
        }

        /* Floating Limits Window */
        .floating-limits-window {
            position: fixed;
            bottom: 80px;
            right: 20px;
            width: 720px;
            height: 560px;
            min-width: 420px;
            min-height: 320px;
            max-width: calc(100vw - 90px);
            max-height: calc(100vh - 40px);
            background: #0b1020;
            border: 1px solid rgba(0, 255, 200, 0.35);
            border-radius: 12px;
            box-shadow: 0 0 40px rgba(0, 255, 200, 0.18);
            z-index: 10007;
            display: none;
            flex-direction: column;
            overflow: hidden;
            resize: both;
        }

        .floating-limits-window.show {
            display: flex;
        }

        .floating-limits-window.minimized {
            height: 50px;
            min-height: 50px;
            resize: none;
        }

        .floating-limits-window.minimized .floating-window-content {
            display: none;
        }

        .floating-limits-window .floating-window-content {
            overflow: auto;
            background: #0b1020;
            padding: 12px;
        }

        .floating-ai-templates-window {
            position: fixed;
            bottom: 80px;
            right: 20px;
            width: 860px;
            height: 620px;
            min-width: 520px;
            min-height: 360px;
            max-width: calc(100vw - 90px);
            max-height: calc(100vh - 40px);
            background: #0b1020;
            border: 1px solid rgba(96, 165, 250, 0.4);
            border-radius: 12px;
            box-shadow: 0 0 40px rgba(96, 165, 250, 0.18);
            z-index: 10008;
            display: none;
            flex-direction: column;
            overflow: hidden;
            resize: both;
        }

        .floating-ai-templates-window.show {
            display: flex;
        }

        .floating-ai-templates-window.minimized {
            height: 50px;
            min-height: 50px;
            resize: none;
        }

        .floating-ai-templates-window.minimized .floating-window-content {
            display: none;
        }

        .templates-layout {
            display: grid;
            grid-template-columns: 220px 1fr;
            gap: 12px;
            height: 100%;
            min-height: 0;
        }

        .templates-sidebar {
            border: 1px solid rgba(96, 165, 250, 0.2);
            border-radius: 8px;
            background: rgba(12, 18, 40, 0.6);
            padding: 8px;
            overflow-y: auto;
            display: flex;
            flex-direction: column;
            gap: 4px;
        }

        .templates-sidebar-item {
            padding: 8px 10px;
            border-radius: 6px;
            cursor: pointer;
            color: #c9d1d9;
            font-size: 13px;
            border: 1px solid transparent;
            transition: background 0.15s, border-color 0.15s;
        }

        .templates-sidebar-item:hover {
            background: rgba(96, 165, 250, 0.12);
        }

        .templates-sidebar-item.active {
            background: rgba(96, 165, 250, 0.2);
            border-color: rgba(96, 165, 250, 0.5);
            color: #93c5fd;
            font-weight: 700;
        }

        .templates-sidebar-item.archived {
            opacity: 0.7;
        }

        .templates-sidebar-add {
            margin-top: 8px;
            padding: 8px 10px;
            border-radius: 6px;
            border: 1px solid rgba(96, 165, 250, 0.45);
            background: rgba(96, 165, 250, 0.12);
            color: #93c5fd;
            cursor: pointer;
            font-size: 12px;
            font-weight: 700;
            text-align: center;
        }

        .templates-sidebar-add:hover {
            background: rgba(96, 165, 250, 0.22);
        }

        .templates-editor {
            border: 1px solid rgba(96, 165, 250, 0.2);
            border-radius: 8px;
            background: rgba(12, 18, 40, 0.5);
            padding: 12px;
            overflow-y: auto;
            min-height: 0;
        }

        .templates-empty {
            color: #9aa8b8;
            font-size: 13px;
            text-align: center;
            padding: 24px 10px;
        }

        .template-field {
            display: grid;
            gap: 6px;
            margin-bottom: 10px;
        }

        .template-field label {
            color: #9fb8ce;
            font-size: 12px;
            font-weight: 600;
        }

        .template-field input,
        .template-field select,
        .template-field textarea {
            width: 100%;
            background: rgba(30, 41, 59, 0.8);
            border: 1px solid rgba(148, 163, 184, 0.35);
            border-radius: 6px;
            color: #e2e8f0;
            padding: 7px 9px;
            font-size: 13px;
        }

        .template-field textarea {
            min-height: 72px;
            resize: vertical;
        }

        .template-query-text-row {
            display: grid;
            grid-template-columns: minmax(0, 1fr) minmax(220px, 30ch);
            gap: 10px;
            align-items: start;
        }

        .template-actions {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            margin-bottom: 12px;
        }

        .template-btn {
            border: 1px solid rgba(148, 163, 184, 0.35);
            background: rgba(30, 41, 59, 0.9);
            color: #e2e8f0;
            border-radius: 6px;
            font-size: 12px;
            font-weight: 700;
            padding: 7px 10px;
            cursor: pointer;
        }

        .template-btn:hover {
            border-color: rgba(125, 211, 252, 0.5);
            color: #7dd3fc;
        }

        .template-btn.primary {
            border-color: rgba(52, 211, 153, 0.45);
            color: #6ee7b7;
            background: rgba(6, 78, 59, 0.35);
        }

        .template-btn.danger {
            border-color: rgba(248, 113, 113, 0.45);
            color: #fca5a5;
            background: rgba(127, 29, 29, 0.32);
        }

        .template-query-list {
            display: grid;
            gap: 8px;
        }

        .template-query-item {
            border: 1px solid rgba(148, 163, 184, 0.3);
            background: rgba(15, 23, 42, 0.7);
            border-radius: 8px;
            padding: 8px;
            display: grid;
            gap: 6px;
        }

        .template-query-title {
            font-size: 13px;
            font-weight: 700;
            color: #dbeafe;
        }

        .template-query-preview {
            font-size: 12px;
            color: #94a3b8;
            white-space: pre-wrap;
        }

        .template-query-actions {
            display: flex;
            flex-wrap: wrap;
            gap: 6px;
        }

        .limits-layout {
            display: grid;
            grid-template-columns: 180px 1fr;
            gap: 12px;
            height: 100%;
            min-height: 0;
        }

        .limits-sidebar {
            border: 1px solid rgba(0, 255, 200, 0.2);
            border-radius: 8px;
            background: rgba(12, 18, 40, 0.6);
            padding: 8px;
            overflow-y: auto;
            display: flex;
            flex-direction: column;
            gap: 4px;
        }

        .limits-sidebar-item {
            padding: 8px 10px;
            border-radius: 6px;
            cursor: pointer;
            color: #c9d1d9;
            font-size: 13px;
            border: 1px solid transparent;
            transition: background 0.15s, border-color 0.15s;
        }

        .limits-sidebar-item:hover {
            background: rgba(0, 255, 200, 0.08);
        }

        .limits-sidebar-item.active {
            background: rgba(0, 255, 200, 0.14);
            border-color: rgba(0, 255, 200, 0.4);
            color: #00ffc8;
            font-weight: 700;
        }

        .limits-sidebar-add {
            margin-top: 8px;
            padding: 8px 10px;
            border-radius: 6px;
            border: 1px solid rgba(0, 255, 200, 0.35);
            background: rgba(0, 255, 200, 0.08);
            color: #00ffc8;
            cursor: pointer;
            font-size: 12px;
            font-weight: 700;
            text-align: center;
        }

        .limits-sidebar-add:hover {
            background: rgba(0, 255, 200, 0.18);
        }

        .limits-form {
            border: 1px solid rgba(0, 255, 200, 0.2);
            border-radius: 8px;
            background: rgba(12, 18, 40, 0.5);
            padding: 12px;
            overflow-y: auto;
        }

        .limits-category {
            margin-bottom: 14px;
        }

        .limits-category-title {
            font-size: 13px;
            font-weight: 700;
            color: #7dd3fc;
            margin-bottom: 6px;
            padding-bottom: 4px;
            border-bottom: 1px solid rgba(125, 211, 252, 0.2);
        }

        .limits-field-row {
            display: grid;
            grid-template-columns: 1fr 120px 28px;
            gap: 8px;
            align-items: center;
            margin-bottom: 6px;
        }

        .limits-field-row label {
            font-size: 12px;
            color: #9aa8b8;
        }

        .limits-field-row input {
            width: 100%;
            padding: 5px 8px;
            background: rgba(30, 41, 59, 0.8);
            border: 1px solid rgba(0, 255, 255, 0.25);
            border-radius: 6px;
            color: #e6edf3;
            font-size: 13px;
        }

        .limits-whatsapp-toggle {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 28px;
            height: 28px;
        }

        .limits-whatsapp-checkbox {
            width: 16px !important;
            height: 16px !important;
            margin: 0 !important;
            accent-color: #00ffc8;
        }

        .limits-actions {
            display: flex;
            gap: 8px;
            margin-top: 12px;
            justify-content: flex-end;
        }

        .limits-btn {
            padding: 8px 16px;
            border-radius: 8px;
            border: none;
            cursor: pointer;
            font-weight: 700;
            font-size: 13px;
        }

        .limits-btn.save {
            background: linear-gradient(135deg, #00ffc8 0%, #7dd3fc 100%);
            color: #0b1020;
        }

        .limits-btn.delete {
            background: linear-gradient(135deg, #fda4af 0%, #fb7185 100%);
            color: #2b0b11;
        }

        .limits-empty {
            text-align: center;
            padding: 40px 20px;
            color: #7f8c9f;
        }

        .floating-window-content {
            flex: 1;
            overflow: hidden;
            background: #0b1020;
        }

        .floating-window-content iframe {
            width: 100%;
            height: 100%;
            border: none;
            display: block;
        }

        body.force-read-active {
            overflow: hidden;
        }

        .force-read-overlay {
            position: fixed;
            inset: 0;
            z-index: 25000;
            display: none;
            align-items: center;
            justify-content: center;
            padding: 20px;
            background: rgba(6, 10, 22, 0.84);
            backdrop-filter: blur(3px);
        }

        .force-read-overlay.show {
            display: flex;
        }

        .force-read-card {
            width: min(680px, 96vw);
            border-radius: 12px;
            border: 1px solid rgba(255, 90, 90, 0.65);
            background: linear-gradient(180deg, rgba(30, 10, 14, 0.95), rgba(18, 10, 24, 0.96));
            box-shadow: 0 12px 34px rgba(0, 0, 0, 0.5), 0 0 28px rgba(255, 70, 70, 0.2);
            padding: 18px;
            color: #f7e8e8;
        }

        .force-read-title {
            font-size: 1.2em;
            font-weight: 800;
            color: #ff8b8b;
            margin-bottom: 10px;
            letter-spacing: 0.2px;
        }

        .force-read-meta {
            color: #ffd6d6;
            font-size: 0.95em;
            margin-bottom: 12px;
        }

        .force-read-message {
            border: 1px solid rgba(255, 140, 140, 0.35);
            background: rgba(255, 255, 255, 0.04);
            border-radius: 8px;
            padding: 12px;
            margin-bottom: 14px;
            white-space: pre-wrap;
            word-break: break-word;
            line-height: 1.42;
        }

        .force-read-actions {
            display: flex;
            justify-content: flex-end;
        }

        .force-read-ack-btn {
            border: none;
            border-radius: 8px;
            padding: 10px 14px;
            font-weight: 700;
            cursor: pointer;
            color: #1a0808;
            background: linear-gradient(135deg, #ffb3b3, #ff6b6b);
        }

        .force-read-ack-btn:hover {
            filter: brightness(1.04);
        }

        @media (max-width: 768px) {
            .metadata { flex-direction: column; }
            .grid { grid-template-columns: 1fr; }
            .template-query-text-row { grid-template-columns: 1fr; }
            .ai-assistant-header,
            .ai-assistant-actions,
            .ai-assistant-response-header {
                flex-direction: column;
                align-items: stretch;
            }

            .ai-assistant-controls {
                width: 100%;
                justify-content: stretch;
                flex-wrap: wrap;
            }

            .ai-assistant-btn {
                flex: 1;
            }

            .sidebar {
                position: fixed;
                width: 60px;
                padding-top: 16px;
            }
            .sidebar .nav-label {
                font-size: 0.7em;
            }
            .sidebar .nav-icon {
                font-size: 1.4em;
                margin-bottom: 1px;
            }
            .sidebar nav ul li {
                padding: 12px 0 8px 0;
                font-size: 1em;
                gap: 2px;
            }
            .container {
                margin-left: 60px !important;
            }
            .container.monitor-floating {
                left: 64px;
                top: 8px;
                width: calc(100vw - 72px);
                height: calc(100vh - 16px);
                max-width: calc(100vw - 72px);
                max-height: calc(100vh - 16px);
                min-width: 280px;
                min-height: 200px;
            }
            .floating-commands-window {
                width: calc(100% - 80px);
                right: 10px;
            }
            .floating-alarms-window {
                width: calc(100% - 80px);
                height: 50vh;
                min-width: 280px;
                min-height: 220px;
                right: 10px;
                left: auto;
                bottom: 10px;
                max-width: calc(100vw - 80px);
                max-height: calc(100vh - 20px);
            }
            .floating-map-window {
                width: calc(100% - 80px);
                height: 60vh;
                min-width: 280px;
                min-height: 220px;
                right: 10px;
                bottom: 10px;
                max-width: calc(100vw - 80px);
                max-height: calc(100vh - 20px);
            }
        }

        .main-container {
            margin-left: 72px;
        }

        .header-controls {
            display: flex;
            align-items: center;
            gap: 16px;
        }

        .header-select-controls {
            display: flex;
            align-items: center;
            gap: 8px;
            color: #7dd3fc;
            font-size: 13px;
        }

        #farmSelect,
        #languageSelect {
            padding: 6px 10px;
            background: rgba(30, 41, 59, 0.85);
            border: 1px solid rgba(0, 255, 255, 0.3);
            border-radius: 6px;
            color: #e6edf3;
            font-size: 12px;
            cursor: pointer;
        }

        #farmSelect {
            display: none;
            min-width: 140px;
        }

        #languageSelect {
            min-width: 130px;
        }

        #logoutBtn {
            padding: 6px 12px;
            background: rgba(255, 100, 100, 0.2);
            border: 1px solid rgba(255, 100, 100, 0.4);
            color: #ff6464;
            border-radius: 6px;
            cursor: pointer;
            font-size: 12px;
            font-weight: 600;
            display: none;
        }

        #minimizeMonitorBtn,
        #monitorDragHandle {
            display: none;
        }

        .filters-row {
            display: flex;
            gap: 12px;
            align-items: center;
            flex-wrap: wrap;
            margin-top: 12px;
            width: 100%;
        }

        .filter-group {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .filter-label {
            color: #7dd3fc;
            font-size: 13px;
            font-weight: 500;
        }

        #poolIdSelect,
        #activityWindowMinutes,
        #filterSelect,
        #viewModeSelect,
        #mapStatusFilter,
        #mapColorModeSelect {
            padding: 6px 10px;
            background: rgba(30, 41, 59, 0.8);
            border: 1px solid rgba(0, 255, 255, 0.3);
            border-radius: 6px;
            color: #e6edf3;
            font-size: 13px;
        }

        #poolIdSelect {
            width: 120px;
            font-family: 'Courier New', monospace;
        }

        #activityWindowMinutes {
            width: 80px;
        }

        #filterSelect,
        #viewModeSelect,
        #mapStatusFilter,
        #mapColorModeSelect {
            cursor: pointer;
        }

        #filterSelect,
        #viewModeSelect,
        #mapStatusFilter {
            min-width: 150px;
        }

        #mapColorModeSelect {
            min-width: 170px;
        }

        #poolIdClear {
            padding: 6px 14px;
            background: linear-gradient(135deg, #7dd3fc 0%, #22d3ee 100%);
            color: #0b1020;
            border: none;
            border-radius: 6px;
            font-size: 12px;
            font-weight: 600;
            cursor: pointer;
            text-transform: uppercase;
        }

        #poolIdInlineMsg {
            width: 100%;
            color: #fda4af;
            font-size: 12px;
            min-height: 16px;
            padding-left: 54px;
        }

        #doHistoryBtn {
            display: none;
        }

        #longitude,
        #latitude {
            cursor: pointer;
            text-decoration: underline;
        }

        #powerMessageBanner {
            display: none;
            margin: 10px 12px 0;
            padding: 8px 10px;
            border-radius: 8px;
            border: 1px solid rgba(255, 204, 102, 0.45);
            background: rgba(255, 204, 102, 0.12);
            color: #ffd86b;
            font-size: 12px;
        }

        #floatingAuthWindow {
            width: min(1100px, calc(100vw - 48px));
            height: min(760px, calc(100vh - 48px));
        }

        #floatingAuthWindow .floating-window-content,
        #floatingAiTemplatesWindow .floating-window-content {
            padding: 12px;
            overflow: auto;
        }

        .limits-title-icon {
            width: 20px;
            height: 20px;
            object-fit: contain;
            vertical-align: middle;
        }
