        :root {
            --primary: #2563eb;
            --primary-dark: #1d4ed8;
            --secondary: #64748b;
            --success: #22c55e;
            --warning: #f59e0b;
            --danger: #ef4444;
            --bg-dark: #1a1a2e;
            --bg-card: #16213e;
            --bg-input: #1f3460;
            --bg-sidebar: #0f0f23;
            --text-primary: #f1f5f9;
            --text-secondary: #94a3b8;
            --border: #2d4a7c;
            
            /* Pipe colors */
            --pipe-hot: #ef4444;
            --pipe-cold: #3b82f6;
            --pipe-return: #8b5cf6;
            --pipe-gas: #eab308;
            
            /* Mode colors */
            --mode-off: #6b7280;
            --mode-night: #3b82f6;
            --mode-day: #f59e0b;
            --mode-frost: #06b6d4;
            --mode-eco: #22c55e;
            --mode-auto: #22c55e;
            
            /* Feature colors */
            --water: #0ea5e9;
            --water-dark: #0284c7;
            --app: #8b5cf6;
            --app-dark: #7c3aed;
            --viz: #10b981;
            
            --sidebar-width: 240px;
        }

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

        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
            background: var(--bg-dark);
            color: var(--text-primary);
            min-height: 100vh;
        }

        /* ==========================================
           LAYOUT
           ========================================== */
        .layout {
            display: flex;
            min-height: 100vh;
        }

        /* ==========================================
           SIDEBAR
           ========================================== */
        .sidebar {
            width: var(--sidebar-width);
            background: var(--bg-sidebar);
            border-right: 1px solid var(--border);
            display: flex;
            flex-direction: column;
            position: fixed;
            top: 0;
            left: 0;
            height: 100vh;
            z-index: 1000;
            transition: transform 0.3s ease;
        }

        .sidebar-header {
            padding: 20px;
            border-bottom: 1px solid var(--border);
        }

        .sidebar-logo {
            display: flex;
            align-items: center;
            gap: 12px;
            text-decoration: none;
            color: var(--text-primary);
        }

        .sidebar-logo-icon {
            width: 44px;
            height: 44px;
            background: linear-gradient(135deg, var(--primary), var(--viz));
            border-radius: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 22px;
        }

        .sidebar-logo-text {
            font-size: 20px;
            font-weight: 700;
        }

        .sidebar-logo-subtitle {
            font-size: 11px;
            color: var(--text-secondary);
            margin-top: 2px;
        }

        .sidebar-nav {
            flex: 1;
            padding: 12px 10px;
            overflow-y: auto;
        }

        .nav-section {
            margin-bottom: 16px;
        }

        .nav-section-title {
            font-size: 10px;
            text-transform: uppercase;
            letter-spacing: 1.5px;
            color: var(--text-secondary);
            padding: 0 12px;
            margin-bottom: 6px;
        }

        .nav-item {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 10px 14px;
            border-radius: 8px;
            color: var(--text-secondary);
            text-decoration: none;
            font-size: 13px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s;
            margin-bottom: 2px;
            border: none;
            background: transparent;
            width: 100%;
            text-align: left;
        }

        .nav-item:hover {
            background: var(--bg-input);
            color: var(--text-primary);
        }

        .nav-item.active {
            background: var(--primary);
            color: white;
        }

        .nav-item.active.viz { background: var(--viz); }
        .nav-item.active.water { background: var(--water); }
        .nav-item.active.app { background: var(--app); }

        .nav-item-icon {
            font-size: 15px;
            width: 20px;
            text-align: center;
        }

        .sidebar-footer {
            padding: 14px;
            border-top: 1px solid var(--border);
            font-size: 11px;
        }

        .sidebar-user {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 10px;
            background: var(--bg-input);
            border-radius: 10px;
            margin-bottom: 12px;
        }

        .sidebar-user-avatar {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            background: var(--primary);
            color: white;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 600;
            font-size: 13px;
        }

        .sidebar-user-info {
            flex: 1;
            min-width: 0;
        }

        .sidebar-user-name {
            font-weight: 600;
            font-size: 13px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .sidebar-user-role {
            font-size: 11px;
            color: var(--text-secondary);
        }

        .sidebar-logout-btn {
            background: none;
            border: none;
            font-size: 18px;
            cursor: pointer;
            padding: 6px;
            border-radius: 6px;
            transition: all 0.2s;
            opacity: 0.7;
        }

        .sidebar-logout-btn:hover {
            background: rgba(239, 68, 68, 0.15);
            opacity: 1;
        }

        .sidebar-footer-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
        }

        .sidebar-status {
            display: flex;
            align-items: center;
            gap: 8px;
            color: var(--text-secondary);
        }

        .sidebar-status-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: var(--success);
        }

        .sidebar-info {
            margin-top: 6px;
            color: var(--text-secondary);
            font-size: 10px;
            text-align: center;
        }

        /* ==========================================
           MAIN CONTENT
           ========================================== */
        .main-content {
            flex: 1;
            margin-left: var(--sidebar-width);
            min-height: 100vh;
        }

        .main-header {
            display: none;
            align-items: center;
            justify-content: space-between;
            padding: 12px 16px;
            background: var(--bg-sidebar);
            border-bottom: 1px solid var(--border);
            position: sticky;
            top: 0;
            z-index: 100;
        }

        .menu-toggle {
            width: 40px;
            height: 40px;
            background: var(--bg-input);
            border: none;
            border-radius: 8px;
            color: var(--text-primary);
            font-size: 20px;
            cursor: pointer;
        }

        .mobile-title {
            font-size: 15px;
            font-weight: 600;
        }

        .sidebar-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.6);
            z-index: 999;
        }

        .sidebar-close {
            display: none;
            position: absolute;
            top: 16px;
            right: 16px;
            width: 32px;
            height: 32px;
            background: var(--bg-input);
            border: none;
            border-radius: 8px;
            color: var(--text-primary);
            font-size: 18px;
            cursor: pointer;
            align-items: center;
            justify-content: center;
        }

        .content-wrapper {
            padding: 20px;
        }

        .container {
            max-width: 1200px;
            margin: 0 auto;
        }

        /* Tab Content */
        .tab-content {
            display: none;
        }

        .tab-content.active {
            display: block;
            animation: fadeIn 0.3s ease;
        }

        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(10px); }
            to { opacity: 1; transform: translateY(0); }
        }

        @keyframes slideIn {
            from { opacity: 0; transform: translateX(100px); }
            to { opacity: 1; transform: translateX(0); }
        }

        @keyframes slideOut {
            from { opacity: 1; transform: translateX(0); }
            to { opacity: 0; transform: translateX(100px); }
        }

        /* ==========================================
           CARDS
           ========================================== */
        .card {
            background: var(--bg-card);
            border-radius: 12px;
            padding: 20px;
            margin-bottom: 16px;
            border: 1px solid var(--border);
        }

        .card-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 16px;
            padding-bottom: 12px;
            border-bottom: 1px solid var(--border);
        }

        .card-title {
            font-size: 16px;
            font-weight: 600;
        }

        .page-title {
            font-size: 22px;
            font-weight: 600;
            margin-bottom: 20px;
            display: flex;
            align-items: center;
            gap: 12px;
        }

        /* ==========================================
           BUTTONS
           ========================================== */
        .btn {
            padding: 10px 20px;
            border: none;
            border-radius: 8px;
            font-size: 13px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s;
            display: inline-flex;
            align-items: center;
            gap: 8px;
        }

        .btn-primary { background: var(--primary); color: white; }
        .btn-primary:hover { background: var(--primary-dark); }
        .btn-secondary { background: var(--bg-input); color: var(--text-primary); }
        .btn-secondary:hover { background: var(--border); }
        .btn-success { background: var(--success); color: white; }
        .btn-danger { background: var(--danger); color: white; }
        .btn-water { background: var(--water); color: white; }
        .btn-water:hover { background: var(--water-dark); }
        .btn-app { background: var(--app); color: white; }
        .btn-app:hover { background: var(--app-dark); }
        .btn-sm { padding: 6px 12px; font-size: 12px; }
        .btn-lg { padding: 14px 28px; font-size: 16px; }
        .btn:disabled { opacity: 0.5; cursor: not-allowed; }
        .btn-group { display: flex; gap: 8px; flex-wrap: wrap; }

        .btn-toggle {
            padding: 8px 16px;
            border: 2px solid var(--border);
            background: transparent;
            color: var(--text-secondary);
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.2s;
        }

        .btn-toggle:hover {
            border-color: var(--primary);
            color: var(--text-primary);
        }

        .btn-toggle.active {
            border-color: var(--primary);
            background: var(--primary);
            color: white;
        }

        /* ==========================================
           MODE BUTTONS
           ========================================== */
        .mode-selector {
            display: flex;
            gap: 12px;
            flex-wrap: wrap;
        }

        .mode-btn {
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: 16px 24px;
            background: var(--bg-input);
            border: 2px solid transparent;
            border-radius: 12px;
            cursor: pointer;
            transition: all 0.2s;
            min-width: 100px;
            color: var(--text-primary);
        }

        .mode-btn:hover {
            border-color: var(--border);
            transform: translateY(-2px);
        }

        .mode-btn.active {
            border-color: var(--success);
            background: rgba(34, 197, 94, 0.15);
        }

        .mode-btn-icon {
            font-size: 32px;
            margin-bottom: 8px;
        }

        .mode-btn-label {
            font-size: 12px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            color: var(--text-secondary);
        }

        .mode-btn.active .mode-btn-label {
            color: var(--success);
        }

        /* ==========================================
           FORM ELEMENTS
           ========================================== */
        .form-group {
            margin-bottom: 16px;
        }

        .form-label {
            display: block;
            margin-bottom: 6px;
            font-size: 13px;
            color: var(--text-secondary);
            font-weight: 500;
        }

        .form-row {
            display: flex;
            gap: 16px;
            align-items: center;
        }

        input[type="number"],
        input[type="text"],
        input[type="date"],
        input[type="time"],
        select,
        textarea {
            background: var(--bg-input);
            border: 1px solid var(--border);
            border-radius: 8px;
            padding: 10px 14px;
            color: var(--text-primary);
            font-size: 14px;
            width: 100%;
            transition: border-color 0.2s;
        }

        input:focus,
        select:focus,
        textarea:focus {
            outline: none;
            border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
        }

        /* Range slider */
        input[type="range"] {
            -webkit-appearance: none;
            width: 100%;
            height: 8px;
            background: var(--bg-input);
            border-radius: 4px;
            outline: none;
        }

        input[type="range"]::-webkit-slider-thumb {
            -webkit-appearance: none;
            width: 20px;
            height: 20px;
            background: var(--primary);
            border-radius: 50%;
            cursor: pointer;
        }

        /* Checkbox / Toggle */
        .toggle-switch {
            position: relative;
            width: 48px;
            height: 26px;
            background: var(--bg-input);
            border-radius: 13px;
            cursor: pointer;
            transition: background 0.3s;
        }

        .toggle-switch.active {
            background: var(--success);
        }

        .toggle-switch::after {
            content: '';
            position: absolute;
            width: 20px;
            height: 20px;
            background: white;
            border-radius: 50%;
            top: 3px;
            left: 3px;
            transition: transform 0.3s;
        }

        .toggle-switch.active::after {
            transform: translateX(22px);
        }

        /* ==========================================
           DASHBOARD STYLES
           ========================================== */
        .dashboard-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
            flex-wrap: wrap;
            gap: 16px;
        }

        .dashboard-welcome {
            display: flex;
            flex-direction: column;
        }

        .dashboard-welcome span:first-child {
            font-size: 24px;
            font-weight: 700;
        }

        .dashboard-date {
            font-size: 14px;
            color: var(--text-secondary);
        }

        .dashboard-status-row {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
            gap: 16px;
            margin-bottom: 20px;
        }

        .status-card {
            display: flex;
            align-items: center;
            gap: 16px;
            padding: 20px;
            background: var(--bg-card);
            border-radius: 12px;
            border-left: 4px solid var(--primary);
        }

        .status-card.good {
            border-left-color: var(--success);
        }

        .status-card.warning {
            border-left-color: var(--warning);
        }

        .status-card.danger {
            border-left-color: var(--danger);
        }

        .status-card-icon {
            font-size: 32px;
        }

        .status-card-value {
            font-size: 20px;
            font-weight: 700;
        }

        .status-card-label {
            font-size: 12px;
            color: var(--text-secondary);
        }

        .widgets-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            gap: 16px;
        }

        .widget {
            background: var(--bg-card);
            border-radius: 12px;
            overflow: hidden;
            border: 1px solid var(--border);
        }

        .widget.wide {
            grid-column: span 2;
        }

        @media (max-width: 768px) {
            .widget.wide {
                grid-column: span 1;
            }
        }

        .widget-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 16px;
            border-bottom: 1px solid var(--border);
        }

        .widget-title {
            font-weight: 600;
        }

        .widget-menu {
            background: none;
            border: none;
            cursor: pointer;
            font-size: 18px;
            opacity: 0.5;
            padding: 4px 8px;
        }

        .widget-menu:hover {
            opacity: 1;
        }

        .widget-content {
            padding: 16px;
        }

        .widget-temp-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 16px;
        }

        .widget-temp-item {
            text-align: center;
            padding: 12px;
            background: var(--bg-input);
            border-radius: 8px;
        }

        .widget-temp-label {
            font-size: 12px;
            color: var(--text-secondary);
            margin-bottom: 4px;
        }

        .widget-temp-value {
            font-size: 24px;
            font-weight: 700;
            font-family: 'SF Mono', Monaco, 'Consolas', monospace;
        }

        .widget-temp-value.outdoor { color: var(--success); }
        .widget-temp-value.hot { color: var(--danger); }
        .widget-temp-value.water { color: var(--water); }

        .widget-gauge {
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: 10px 0;
        }

        .gauge-svg {
            width: 150px;
            height: 90px;
        }

        .gauge-value {
            font-size: 36px;
            font-weight: 700;
            margin-top: -20px;
        }

        .gauge-unit {
            font-size: 14px;
            color: var(--text-secondary);
        }

        .widget-gauge-range {
            display: flex;
            justify-content: space-between;
            font-size: 11px;
            color: var(--text-secondary);
            margin-top: 8px;
        }

        .widget-mode-display {
            text-align: center;
            padding: 20px 0;
        }

        .widget-mode-icon {
            font-size: 48px;
            margin-bottom: 8px;
        }

        .widget-mode-name {
            font-size: 20px;
            font-weight: 700;
        }

        .widget-mode-detail {
            font-size: 12px;
            color: var(--text-secondary);
        }

        .widget-mode-sub {
            display: flex;
            justify-content: center;
            gap: 20px;
            font-size: 12px;
            color: var(--text-secondary);
            padding-top: 12px;
            border-top: 1px solid var(--border);
        }

        .widget-boilers-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
            gap: 16px;
        }

        .widget-boiler {
            padding: 16px;
            background: var(--bg-input);
            border-radius: 10px;
            text-align: center;
        }

        .widget-boiler.active {
            border: 1px solid var(--success);
        }

        .widget-boiler-name {
            font-weight: 600;
            margin-bottom: 8px;
        }

        .widget-boiler-power {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-bottom: 8px;
        }

        .widget-boiler-bar {
            flex: 1;
            height: 6px;
            background: var(--bg-card);
            border-radius: 3px;
            overflow: hidden;
        }

        .widget-boiler-fill {
            height: 100%;
            background: linear-gradient(90deg, var(--warning), var(--danger));
            border-radius: 3px;
        }

        .widget-boiler-temp {
            font-size: 18px;
            font-weight: 700;
            color: var(--danger);
        }

        .widget-boiler-status {
            font-size: 11px;
            margin-top: 4px;
        }

        .widget-boiler-status.on { color: var(--success); }
        .widget-boiler-status.off { color: var(--text-secondary); }

        .widget-consumption {
            display: flex;
            align-items: baseline;
            justify-content: center;
            gap: 8px;
            margin-bottom: 8px;
        }

        .widget-consumption-value {
            font-size: 42px;
            font-weight: 700;
        }

        .widget-consumption-unit {
            font-size: 18px;
            color: var(--text-secondary);
        }

        .widget-consumption-compare {
            text-align: center;
            font-size: 13px;
            margin-bottom: 16px;
        }

        .widget-consumption-compare .trend {
            font-weight: 600;
        }

        .widget-consumption-compare .trend.down { color: var(--success); }
        .widget-consumption-compare .trend.up { color: var(--danger); }

        .widget-consumption-bar {
            height: 8px;
            background: var(--bg-input);
            border-radius: 4px;
            overflow: hidden;
            margin-bottom: 4px;
        }

        .widget-consumption-fill {
            height: 100%;
            background: var(--primary);
            border-radius: 4px;
        }

        .widget-consumption-range {
            display: flex;
            justify-content: space-between;
            font-size: 10px;
            color: var(--text-secondary);
        }

        .widget-events-list {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .widget-event {
            display: flex;
            gap: 12px;
            padding: 8px;
            background: var(--bg-input);
            border-radius: 6px;
            font-size: 12px;
            border-left: 3px solid var(--border);
        }

        .widget-event.warning { border-left-color: var(--warning); }
        .widget-event.info { border-left-color: var(--primary); }
        .widget-event.success { border-left-color: var(--success); }
        .widget-event.error { border-left-color: var(--danger); }

        .widget-event-time {
            color: var(--text-secondary);
            min-width: 40px;
        }

        .widget-link {
            display: block;
            text-align: center;
            margin-top: 12px;
            font-size: 12px;
            color: var(--primary);
            text-decoration: none;
        }

        .widget-link:hover {
            text-decoration: underline;
        }

        .widget-weather {
            text-align: center;
        }

        .widget-weather-now {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 12px;
            margin-bottom: 8px;
        }

        .widget-weather-icon {
            font-size: 48px;
        }

        .widget-weather-temp {
            font-size: 36px;
            font-weight: 700;
        }

        .widget-weather-location {
            font-size: 12px;
            color: var(--text-secondary);
            margin-bottom: 16px;
        }

        .widget-weather-forecast {
            display: flex;
            justify-content: space-around;
            padding-top: 12px;
            border-top: 1px solid var(--border);
        }

        .widget-weather-day {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 4px;
            font-size: 12px;
        }

        .widget-actions-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 12px;
        }

        .widget-action-btn {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 8px;
            padding: 16px 12px;
            background: var(--bg-input);
            border: 1px solid var(--border);
            border-radius: 10px;
            cursor: pointer;
            transition: all 0.2s;
            font-size: 12px;
        }

        .widget-action-btn:hover {
            border-color: var(--primary);
            background: rgba(59, 130, 246, 0.1);
        }

        .widget-action-btn span:first-child {
            font-size: 24px;
        }

        /* ==========================================
           VISUALIZATION STYLES
           ========================================== */
        .viz-grid {
            display: grid;
            grid-template-columns: 260px 1fr 200px;
            gap: 16px;
            min-height: 500px;
        }

        .viz-left-panel, .viz-right-panel {
            display: flex;
            flex-direction: column;
            gap: 12px;
        }

        .viz-section {
            background: var(--bg-input);
            border-radius: 10px;
            padding: 14px;
        }

        .viz-section-title {
            font-size: 10px;
            text-transform: uppercase;
            letter-spacing: 1px;
            color: var(--text-secondary);
            margin-bottom: 10px;
            font-weight: 600;
        }

        .alarm-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 6px;
        }

        .alarm-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: 10px 4px;
            background: var(--bg-card);
            border-radius: 6px;
            font-size: 9px;
            text-align: center;
            transition: all 0.2s;
            position: relative;
        }

        .alarm-item.active {
            background: rgba(239, 68, 68, 0.2);
        }

        .alarm-icon-wrapper {
            position: relative;
            display: flex;
            align-items: center;
            justify-content: center;
            width: 44px;
            height: 44px;
        }

        .alarm-icon {
            font-size: 22px;
            opacity: 0.5;
            position: relative;
            z-index: 2;
        }

        .alarm-item.active .alarm-icon {
            opacity: 1;
        }

        .alarm-item > span:last-child {
            margin-top: 2px;
        }

        .alarm-item.active > span:last-child {
            color: var(--danger);
            font-weight: 600;
        }

        .alarm-ring {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            width: 24px;
            height: 24px;
            border: 2px solid var(--danger);
            border-radius: 50%;
            opacity: 0;
            pointer-events: none;
        }

        .alarm-item.active .alarm-ring {
            animation: alarmRingPulse 1.8s ease-out infinite;
        }

        .alarm-item.active .alarm-ring:last-child {
            animation-delay: 0.9s;
        }

        @keyframes alarmRingPulse {
            0% {
                width: 24px;
                height: 24px;
                opacity: 1;
            }
            100% {
                width: 70px;
                height: 70px;
                opacity: 0;
            }
        }

        .temp-display {
            background: var(--bg-card);
            border-radius: 8px;
            padding: 12px;
            text-align: center;
        }

        .temp-value {
            font-size: 26px;
            font-weight: 700;
            font-family: 'SF Mono', monospace;
        }

        .temp-value .unit { font-size: 14px; color: var(--text-secondary); }
        .temp-value.hot { color: var(--pipe-hot); }
        .temp-value.cold { color: var(--pipe-cold); }
        .temp-value.warm { color: var(--warning); }

        .boiler-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 8px;
        }

        .boiler-item {
            background: var(--bg-card);
            border-radius: 8px;
            padding: 10px;
            text-align: center;
        }

        .boiler-label {
            font-size: 10px;
            color: var(--text-secondary);
            margin-bottom: 4px;
        }

        .boiler-power {
            font-size: 22px;
            font-weight: 700;
            color: var(--warning);
        }

        .boiler-icon {
            font-size: 28px;
            margin-top: 4px;
        }

        .boiler-icon.active {
            animation: flame 0.5s infinite alternate;
        }

        @keyframes flame {
            from { transform: scale(1); }
            to { transform: scale(1.1); }
        }

        .viz-schema {
            background: var(--bg-dark);
            border-radius: 10px;
            padding: 16px;
            min-height: 400px;
        }

        .schema-svg {
            width: 100%;
            height: 100%;
            min-height: 380px;
        }

        .setpoint-card {
            background: var(--bg-input);
            border-radius: 10px;
            padding: 14px;
            text-align: center;
        }

        .setpoint-label {
            font-size: 10px;
            color: var(--text-secondary);
            text-transform: uppercase;
            margin-bottom: 6px;
        }

        .setpoint-value {
            font-size: 32px;
            font-weight: 700;
            color: var(--warning);
            font-family: 'SF Mono', monospace;
        }

        .water-refill-mini {
            background: var(--bg-input);
            border-radius: 10px;
            padding: 14px;
            text-align: center;
            cursor: pointer;
            transition: all 0.2s;
            border: 2px solid transparent;
        }

        .water-refill-mini:hover {
            border-color: var(--water);
        }

        .water-refill-icon {
            font-size: 28px;
            margin-bottom: 6px;
        }

        .water-refill-progress {
            height: 6px;
            background: var(--bg-dark);
            border-radius: 3px;
            margin-top: 8px;
            overflow: hidden;
        }

        .water-refill-progress-fill {
            height: 100%;
            background: var(--water);
            border-radius: 3px;
            width: 0%;
            transition: width 0.3s;
        }

        /* ==========================================
           CALORIMETERS
           ========================================== */
        .calor-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
            gap: 16px;
        }

        .calor-card {
            background: var(--bg-card);
            border-radius: 12px;
            padding: 20px;
            text-align: center;
            border: 1px solid var(--border);
        }

        .calor-icon { font-size: 40px; margin-bottom: 10px; }
        .calor-title {
            font-size: 13px;
            color: var(--text-secondary);
            margin-bottom: 12px;
            text-transform: uppercase;
            letter-spacing: 1px;
        }

        .calor-value {
            font-size: 42px;
            font-weight: 700;
            font-family: 'SF Mono', monospace;
        }

        .calor-unit { font-size: 13px; color: var(--text-secondary); }

        .calor-details {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 10px;
            margin-top: 16px;
            padding-top: 12px;
            border-top: 1px solid var(--border);
        }

        .calor-detail-value {
            font-size: 16px;
            font-weight: 600;
            font-family: 'SF Mono', monospace;
        }

        .calor-detail-label {
            font-size: 10px;
            color: var(--text-secondary);
            text-transform: uppercase;
        }

        /* ==========================================
           DATA TABLES
           ========================================== */
        .data-table {
            width: 100%;
            border-collapse: collapse;
        }

        .data-table th,
        .data-table td {
            padding: 12px;
            text-align: left;
            border-bottom: 1px solid var(--border);
        }

        .data-table th {
            background: var(--bg-input);
            font-size: 11px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            color: var(--text-secondary);
            font-weight: 600;
        }

        .data-table tr:hover {
            background: rgba(255,255,255,0.02);
        }

        .data-table td { font-size: 13px; }

        .badge {
            display: inline-block;
            padding: 4px 10px;
            border-radius: 20px;
            font-size: 11px;
            font-weight: 600;
        }

        .badge-success { background: rgba(34, 197, 94, 0.2); color: var(--success); }
        .badge-warning { background: rgba(245, 158, 11, 0.2); color: var(--warning); }
        .badge-danger { background: rgba(239, 68, 68, 0.2); color: var(--danger); }
        .badge-info { background: rgba(59, 130, 246, 0.2); color: var(--primary); }

        .event-icon {
            width: 26px;
            height: 26px;
            border-radius: 6px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-size: 12px;
            margin-right: 6px;
        }

        .event-icon.alarm { background: var(--danger); }
        .event-icon.warning { background: var(--warning); }
        .event-icon.info { background: var(--primary); }
        .event-icon.success { background: var(--success); }

        .filter-bar {
            display: flex;
            gap: 12px;
            margin-bottom: 16px;
            flex-wrap: wrap;
            align-items: flex-end;
        }

        .filter-group {
            display: flex;
            flex-direction: column;
            gap: 4px;
        }

        .filter-group label { font-size: 11px; color: var(--text-secondary); }
        .filter-group input,
        .filter-group select { width: auto; min-width: 140px; }

        .stats-row {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
            gap: 12px;
            margin-bottom: 16px;
        }

        .stat-card {
            background: var(--bg-input);
            border-radius: 10px;
            padding: 14px;
            text-align: center;
        }

        .stat-value {
            font-size: 28px;
            font-weight: 700;
            font-family: 'SF Mono', monospace;
        }

        .stat-label {
            font-size: 10px;
            color: var(--text-secondary);
            text-transform: uppercase;
            margin-top: 4px;
        }

        .pagination {
            display: flex;
            justify-content: center;
            gap: 6px;
            margin-top: 16px;
        }

        .pagination button {
            padding: 8px 14px;
            background: var(--bg-input);
            border: 1px solid var(--border);
            border-radius: 6px;
            color: var(--text-primary);
            cursor: pointer;
            font-size: 12px;
        }

        .pagination button:hover { background: var(--border); }
        .pagination button.active { background: var(--primary); border-color: var(--primary); }

        /* ==========================================
           EQUITHERM STYLES
           ========================================== */
        .equitherm-controls {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 16px;
            margin-bottom: 20px;
        }

        .equitherm-chart {
            background: var(--bg-input);
            border-radius: 12px;
            padding: 30px 20px 30px 40px;
            margin-top: 20px;
        }

        .equitherm-chart svg {
            width: 100%;
            height: auto;
            display: block;
        }

        /* ==========================================
           SCHEDULE STYLES
           ========================================== */
        .schedule-day-selector {
            display: flex;
            gap: 8px;
            margin-bottom: 20px;
            flex-wrap: wrap;
        }

        .day-btn {
            padding: 10px 16px;
            border: 2px solid var(--border);
            background: transparent;
            color: var(--text-secondary);
            border-radius: 8px;
            cursor: pointer;
            font-weight: 500;
            transition: all 0.2s;
        }

        .day-btn:hover {
            border-color: var(--primary);
            color: var(--text-primary);
        }

        .day-btn.active {
            border-color: var(--primary);
            background: var(--primary);
            color: white;
        }

        .timeline-bar {
            height: 60px;
            background: var(--bg-input);
            border-radius: 8px;
            position: relative;
            margin-bottom: 20px;
            overflow: hidden;
        }

        .timeline-segment {
            position: absolute;
            height: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 11px;
            font-weight: 600;
            color: white;
            text-shadow: 0 1px 2px rgba(0,0,0,0.3);
        }

        .timeline-hours {
            display: flex;
            justify-content: space-between;
            font-size: 10px;
            color: var(--text-secondary);
            padding: 0 2px;
            margin-bottom: 16px;
        }

        .schedule-slots {
            display: flex;
            flex-direction: column;
            gap: 12px;
        }

        .schedule-slot {
            display: grid;
            grid-template-columns: 40px 1fr 1fr 1fr 120px 40px;
            gap: 12px;
            align-items: center;
            background: var(--bg-input);
            padding: 12px;
            border-radius: 8px;
        }

        .slot-number {
            width: 32px;
            height: 32px;
            background: var(--bg-card);
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 600;
            font-size: 14px;
        }

        .schedule-time {
            display: flex;
            align-items: center;
            gap: 6px;
        }

        .schedule-time input {
            width: 95px;
            text-align: center;
        }

        .schedule-time-separator {
            color: var(--text-secondary);
            font-weight: 600;
        }

        .schedule-delete {
            width: 32px;
            height: 32px;
            border: none;
            background: transparent;
            color: var(--text-secondary);
            cursor: pointer;
            border-radius: 8px;
            font-size: 18px;
        }

        .schedule-delete:hover {
            background: var(--danger);
            color: white;
        }

        /* ==========================================
           DHW STYLES
           ========================================== */
        .dhw-container {
            display: grid;
            grid-template-columns: 200px 1fr;
            gap: 20px;
        }

        .dhw-selector {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .dhw-btn {
            padding: 14px;
            border: 2px solid var(--border);
            background: var(--bg-input);
            color: var(--text-primary);
            border-radius: 10px;
            cursor: pointer;
            text-align: left;
            transition: all 0.2s;
        }

        .dhw-btn:hover {
            border-color: var(--water);
        }

        .dhw-btn.active {
            border-color: var(--water);
            background: rgba(14, 165, 233, 0.15);
        }

        .dhw-btn-label {
            font-size: 11px;
            color: var(--text-secondary);
            text-transform: uppercase;
            margin-bottom: 4px;
        }

        .dhw-btn-value {
            font-size: 20px;
            font-weight: 700;
            color: var(--water);
        }

        .dhw-settings {
            background: var(--bg-input);
            border-radius: 12px;
            padding: 24px;
        }

        .dhw-temp-control {
            margin-bottom: 24px;
        }

        .dhw-temp-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 12px;
        }

        .dhw-temp-value {
            font-size: 36px;
            font-weight: 700;
            color: var(--water);
            font-family: 'SF Mono', monospace;
        }

        /* ==========================================
           WATER REFILL STYLES
           ========================================== */
        .water-refill-container {
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: 20px;
        }

        .water-icon-container {
            position: relative;
            width: 140px;
            height: 140px;
            margin-bottom: 20px;
        }

        .water-icon {
            width: 100%;
            height: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .water-icon svg {
            width: 90px;
            height: 90px;
            filter: drop-shadow(0 4px 12px rgba(14, 165, 233, 0.4));
        }

        .water-icon.active svg {
            animation: waterPulse 1.5s ease-in-out infinite;
        }

        @keyframes waterPulse {
            0%, 100% { transform: scale(1); opacity: 1; }
            50% { transform: scale(1.1); opacity: 0.8; }
        }

        .water-icon-ring {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            border: 4px solid var(--water);
            border-radius: 50%;
            opacity: 0.3;
        }

        .water-icon.active .water-icon-ring {
            animation: ringPulse 1.5s ease-in-out infinite;
        }

        @keyframes ringPulse {
            0%, 100% { transform: scale(1); opacity: 0.3; }
            50% { transform: scale(1.2); opacity: 0; }
        }

        .water-status-label {
            font-size: 22px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 2px;
            margin-bottom: 24px;
            color: var(--water);
        }

        .water-status-label.idle { color: var(--text-secondary); }
        .water-status-label.complete { color: var(--success); }
        .water-status-label.error { color: var(--danger); }

        .pressure-display {
            background: var(--bg-input);
            border-radius: 12px;
            padding: 20px 40px;
            text-align: center;
            margin-bottom: 24px;
            min-width: 260px;
        }

        .pressure-label {
            font-size: 12px;
            color: var(--text-secondary);
            margin-bottom: 6px;
            text-transform: uppercase;
            letter-spacing: 1px;
        }

        .pressure-value {
            font-size: 42px;
            font-weight: 700;
            font-family: 'SF Mono', monospace;
        }

        .pressure-unit {
            font-size: 18px;
            color: var(--text-secondary);
            margin-left: 4px;
        }

        .pressure-bar {
            font-size: 16px;
            color: var(--text-secondary);
            margin-top: 4px;
        }

        .pressure-gauge {
            width: 100%;
            max-width: 300px;
            height: 12px;
            background: var(--bg-card);
            border-radius: 6px;
            margin: 16px auto;
            overflow: hidden;
            position: relative;
        }

        .pressure-gauge-fill {
            height: 100%;
            border-radius: 6px;
            transition: width 0.5s, background 0.5s;
        }

        .pressure-gauge-fill.low { background: var(--danger); }
        .pressure-gauge-fill.medium { background: var(--success); }
        .pressure-gauge-fill.high { background: var(--warning); }

        .water-info-panel {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 16px;
            margin-bottom: 24px;
            width: 100%;
            max-width: 500px;
        }

        .water-info-item {
            background: var(--bg-input);
            border-radius: 10px;
            padding: 14px;
            text-align: center;
        }

        .water-info-label {
            font-size: 10px;
            color: var(--text-secondary);
            text-transform: uppercase;
            margin-bottom: 6px;
        }

        .water-info-value {
            font-size: 18px;
            font-weight: 600;
        }

        .water-progress {
            width: 100%;
            max-width: 400px;
            margin-bottom: 24px;
        }

        .water-progress-bar {
            height: 10px;
            background: var(--bg-input);
            border-radius: 5px;
            overflow: hidden;
            margin-bottom: 8px;
        }

        .water-progress-fill {
            height: 100%;
            background: linear-gradient(90deg, var(--water), var(--water-dark));
            border-radius: 5px;
            transition: width 0.3s;
            animation: shimmer 2s infinite;
        }

        @keyframes shimmer {
            0% { background-position: -200% 0; }
            100% { background-position: 200% 0; }
        }

        .water-progress-text {
            display: flex;
            justify-content: space-between;
            font-size: 13px;
            color: var(--text-secondary);
        }

        /* ==========================================
           PROFILE STYLES
           ========================================== */
        .profile-header {
            display: flex;
            gap: 24px;
            align-items: flex-start;
            flex-wrap: wrap;
        }

        @media (max-width: 600px) {
            .profile-header {
                flex-direction: column;
                align-items: center;
                text-align: center;
            }
        }

        .profile-avatar-section {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 12px;
        }

        .profile-avatar {
            width: 120px;
            height: 120px;
            border-radius: 50%;
            background: var(--bg-input);
            position: relative;
            overflow: hidden;
            border: 4px solid var(--primary);
        }

        .profile-avatar img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .profile-avatar-edit {
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            background: rgba(0,0,0,0.7);
            text-align: center;
            padding: 8px;
            cursor: pointer;
            opacity: 0;
            transition: opacity 0.2s;
        }

        .profile-avatar:hover .profile-avatar-edit {
            opacity: 1;
        }

        .profile-avatar-actions {
            display: flex;
            gap: 8px;
        }

        .profile-info-header {
            flex: 1;
        }

        .profile-name {
            font-size: 28px;
            font-weight: 700;
            margin-bottom: 4px;
        }

        .profile-email {
            font-size: 14px;
            color: var(--text-secondary);
            margin-bottom: 12px;
        }

        .profile-role {
            display: flex;
            gap: 8px;
            flex-wrap: wrap;
        }

        .profile-org-card {
            display: flex;
            gap: 20px;
            align-items: center;
            padding: 20px;
            background: linear-gradient(135deg, rgba(59,130,246,0.1), rgba(59,130,246,0.02));
            border: 1px solid rgba(59,130,246,0.2);
            border-radius: 12px;
            flex-wrap: wrap;
        }

        .profile-org-logo {
            width: 64px;
            height: 64px;
            background: var(--bg-input);
            border-radius: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .profile-org-info {
            flex: 1;
            min-width: 200px;
        }

        .profile-org-name {
            font-size: 20px;
            font-weight: 700;
            margin-bottom: 4px;
        }

        .profile-org-detail {
            font-size: 12px;
            color: var(--text-secondary);
            margin-bottom: 8px;
        }

        .profile-org-role {
            font-size: 13px;
        }

        .profile-org-stats {
            display: flex;
            gap: 24px;
        }

        .profile-org-stat {
            text-align: center;
        }

        .profile-org-stat-value {
            font-size: 28px;
            font-weight: 700;
            color: var(--primary);
        }

        .profile-org-stat-label {
            font-size: 11px;
            color: var(--text-secondary);
        }

        .profile-form {
            display: flex;
            flex-direction: column;
            gap: 16px;
        }

        .form-row {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 16px;
        }

        .profile-notifications {
            display: flex;
            flex-direction: column;
            gap: 4px;
        }

        .profile-notif-item {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 16px;
            background: var(--bg-input);
            border-radius: 10px;
        }

        .profile-notif-info {
            flex: 1;
        }

        .profile-notif-title {
            font-weight: 600;
            margin-bottom: 2px;
        }

        .profile-notif-desc {
            font-size: 12px;
            color: var(--text-secondary);
        }

        .toggle-switch {
            position: relative;
            display: inline-block;
            width: 50px;
            height: 28px;
        }

        .toggle-switch input {
            opacity: 0;
            width: 0;
            height: 0;
        }

        .toggle-slider {
            position: absolute;
            cursor: pointer;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: var(--bg-card);
            transition: 0.3s;
            border-radius: 28px;
        }

        .toggle-slider:before {
            position: absolute;
            content: "";
            height: 22px;
            width: 22px;
            left: 3px;
            bottom: 3px;
            background-color: var(--text-secondary);
            transition: 0.3s;
            border-radius: 50%;
        }

        .toggle-switch input:checked + .toggle-slider {
            background-color: var(--success);
        }

        .toggle-switch input:checked + .toggle-slider:before {
            transform: translateX(22px);
            background-color: white;
        }

        .password-input-wrapper {
            position: relative;
            display: flex;
            align-items: center;
        }

        .password-input-wrapper input {
            flex: 1;
            padding-right: 45px;
        }

        .password-toggle {
            position: absolute;
            right: 8px;
            background: none;
            border: none;
            cursor: pointer;
            font-size: 16px;
            opacity: 0.6;
        }

        .password-toggle:hover {
            opacity: 1;
        }

        .password-strength {
            margin-top: 8px;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .password-strength-bar {
            flex: 1;
            height: 6px;
            background: var(--bg-input);
            border-radius: 3px;
            overflow: hidden;
        }

        .password-strength-fill {
            height: 100%;
            width: 0;
            transition: all 0.3s;
            border-radius: 3px;
        }

        .password-strength-text {
            font-size: 11px;
            min-width: 80px;
        }

        .password-match {
            margin-top: 4px;
            font-size: 12px;
        }

        .password-requirements {
            background: var(--bg-input);
            border-radius: 10px;
            padding: 16px;
            margin-top: 12px;
        }

        .password-req-title {
            font-size: 12px;
            font-weight: 600;
            margin-bottom: 10px;
            color: var(--text-secondary);
        }

        .password-req-item {
            font-size: 12px;
            padding: 4px 0;
            display: flex;
            align-items: center;
            gap: 8px;
            color: var(--text-secondary);
        }

        .password-req-item.valid {
            color: var(--success);
        }

        .password-req-item.valid span {
            color: var(--success);
        }

        .profile-security-grid {
            display: flex;
            flex-direction: column;
            gap: 12px;
        }

        .profile-security-item {
            display: flex;
            align-items: center;
            gap: 16px;
            padding: 16px;
            background: var(--bg-input);
            border-radius: 10px;
        }

        .profile-security-icon {
            font-size: 28px;
        }

        .profile-security-info {
            flex: 1;
        }

        .profile-security-title {
            font-weight: 600;
            margin-bottom: 2px;
        }

        .profile-security-desc {
            font-size: 12px;
            color: var(--text-secondary);
        }

        .profile-danger-zone {
            display: flex;
            flex-direction: column;
            gap: 12px;
        }

        .profile-danger-item {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 16px;
            padding: 16px;
            background: rgba(239, 68, 68, 0.05);
            border: 1px solid rgba(239, 68, 68, 0.2);
            border-radius: 10px;
        }

        .profile-danger-title {
            font-weight: 600;
            margin-bottom: 2px;
        }

        .profile-danger-desc {
            font-size: 12px;
            color: var(--text-secondary);
        }

        /* ==========================================
           DEVICES STYLES
           ========================================== */
        .devices-stats {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
            gap: 16px;
            margin-bottom: 16px;
        }

        .device-stat-card {
            background: var(--bg-card);
            border-radius: 12px;
            padding: 16px;
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .device-stat-icon {
            width: 48px;
            height: 48px;
            border-radius: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 24px;
        }

        .device-stat-icon.online { background: rgba(34, 197, 94, 0.2); }
        .device-stat-icon.offline { background: rgba(239, 68, 68, 0.2); }
        .device-stat-icon.warning { background: rgba(245, 158, 11, 0.2); }
        .device-stat-icon.total { background: rgba(59, 130, 246, 0.2); }

        .device-stat-value {
            font-size: 28px;
            font-weight: 700;
        }

        .device-stat-label {
            font-size: 12px;
            color: var(--text-secondary);
        }

        .devices-actions {
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 16px;
            flex-wrap: wrap;
        }

        .search-box {
            display: flex;
            align-items: center;
            background: var(--bg-input);
            border-radius: 8px;
            padding: 0 12px;
            flex: 1;
            max-width: 300px;
        }

        .search-box input {
            border: none;
            background: transparent;
            padding: 10px;
            flex: 1;
        }

        .search-icon {
            opacity: 0.5;
        }

        .devices-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
            gap: 16px;
        }

        .device-card {
            background: var(--bg-card);
            border-radius: 12px;
            overflow: hidden;
            border: 1px solid var(--border);
            transition: all 0.2s;
        }

        .device-card:hover {
            border-color: var(--primary);
            box-shadow: 0 4px 20px rgba(0,0,0,0.2);
        }

        .device-card.online { border-left: 4px solid var(--success); }
        .device-card.warning { border-left: 4px solid var(--warning); }
        .device-card.offline { border-left: 4px solid var(--danger); }

        .device-card-header {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 16px;
            border-bottom: 1px solid var(--border);
        }

        .device-status-indicator {
            width: 10px;
            height: 10px;
            border-radius: 50%;
        }

        .device-status-indicator.online { background: var(--success); box-shadow: 0 0 8px var(--success); }
        .device-status-indicator.warning { background: var(--warning); box-shadow: 0 0 8px var(--warning); }
        .device-status-indicator.offline { background: var(--danger); }

        .device-name {
            flex: 1;
            font-weight: 600;
        }

        .device-menu-btn {
            background: none;
            border: none;
            font-size: 18px;
            cursor: pointer;
            opacity: 0.5;
            padding: 4px 8px;
        }

        .device-menu-btn:hover {
            opacity: 1;
        }

        .device-card-body {
            padding: 16px;
        }

        .device-info-row {
            display: flex;
            justify-content: space-between;
            padding: 6px 0;
            font-size: 13px;
        }

        .device-info-label {
            color: var(--text-secondary);
        }

        .device-info-value {
            font-weight: 500;
        }

        .device-info-value.mono {
            font-family: 'SF Mono', Monaco, 'Consolas', monospace;
            font-size: 12px;
        }

        .device-warning-banner, .device-offline-banner {
            padding: 10px;
            border-radius: 8px;
            margin-bottom: 12px;
            font-size: 12px;
            font-weight: 600;
        }

        .device-warning-banner {
            background: rgba(245, 158, 11, 0.15);
            color: var(--warning);
        }

        .device-offline-banner {
            background: rgba(239, 68, 68, 0.15);
            color: var(--danger);
        }

        .device-card-footer {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 12px 16px;
            background: var(--bg-input);
            font-size: 11px;
        }

        .device-last-seen {
            color: var(--text-secondary);
        }

        .signal-bars {
            display: inline-flex;
            gap: 2px;
            align-items: flex-end;
            height: 14px;
            margin-right: 6px;
        }

        .signal-bar {
            width: 4px;
            background: var(--border);
            border-radius: 1px;
        }

        .signal-bar:nth-child(1) { height: 4px; }
        .signal-bar:nth-child(2) { height: 7px; }
        .signal-bar:nth-child(3) { height: 10px; }
        .signal-bar:nth-child(4) { height: 14px; }

        .signal-bar.active {
            background: var(--success);
        }

        /* ==========================================
           USERS STYLES
           ========================================== */
        .users-table .user-cell {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .user-avatar {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            background: var(--primary);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 12px;
            font-weight: 700;
            color: white;
        }

        .user-name {
            font-weight: 600;
        }

        .status-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            display: inline-block;
            margin-right: 6px;
        }

        .status-dot.online { background: var(--success); }
        .status-dot.offline { background: var(--text-secondary); }

        .invitations-list {
            display: flex;
            flex-direction: column;
            gap: 12px;
        }

        .invitation-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 16px;
            background: var(--bg-input);
            border-radius: 10px;
            gap: 16px;
            flex-wrap: wrap;
        }

        .invitation-email {
            font-weight: 600;
        }

        .invitation-meta {
            font-size: 12px;
            color: var(--text-secondary);
        }

        .invitation-actions {
            display: flex;
            gap: 8px;
        }

        .roles-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 16px;
        }

        .role-card {
            background: var(--bg-input);
            border-radius: 10px;
            padding: 16px;
        }

        .role-header {
            margin-bottom: 12px;
        }

        .role-permissions {
            list-style: none;
            padding: 0;
            margin: 0;
            font-size: 12px;
        }

        .role-permissions li {
            padding: 4px 0;
            color: var(--text-secondary);
        }

        /* ==========================================
           LOGS STYLES
           ========================================== */
        .log-filters {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
            gap: 12px;
        }

        .log-live-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
            gap: 16px;
        }

        .log-live-toggle {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .log-live-indicator {
            color: var(--success);
            animation: blink 1s infinite;
        }

        @keyframes blink {
            50% { opacity: 0.3; }
        }

        .log-container {
            padding: 0;
        }

        .log-entries {
            max-height: 500px;
            overflow-y: auto;
            font-family: 'SF Mono', Monaco, 'Consolas', monospace;
            font-size: 12px;
        }

        .log-entry {
            display: flex;
            gap: 12px;
            padding: 8px 16px;
            border-bottom: 1px solid var(--border);
            align-items: flex-start;
        }

        .log-entry:hover {
            background: var(--bg-input);
        }

        .log-time {
            color: var(--text-secondary);
            min-width: 90px;
        }

        .log-level {
            min-width: 60px;
            padding: 2px 6px;
            border-radius: 4px;
            font-size: 10px;
            font-weight: 700;
            text-align: center;
        }

        .log-level.error { background: rgba(239,68,68,0.2); color: var(--danger); }
        .log-level.warning { background: rgba(245,158,11,0.2); color: var(--warning); }
        .log-level.info { background: rgba(59,130,246,0.2); color: var(--primary); }
        .log-level.debug { background: var(--bg-input); color: var(--text-secondary); }

        .log-source {
            color: var(--text-secondary);
            min-width: 120px;
        }

        .log-message {
            flex: 1;
            word-break: break-word;
        }

        .log-stats {
            display: flex;
            gap: 24px;
            padding: 16px;
            background: var(--bg-card);
            border-radius: 12px;
            margin-top: 16px;
            flex-wrap: wrap;
        }

        .log-stat {
            text-align: center;
        }

        .log-stat-value {
            font-size: 24px;
            font-weight: 700;
        }

        .log-stat-label {
            font-size: 11px;
            color: var(--text-secondary);
        }

        /* ==========================================
           INTEGRATIONS STYLES
           ========================================== */
        .api-keys-list, .webhooks-list {
            display: flex;
            flex-direction: column;
            gap: 16px;
        }

        .api-key-item, .webhook-item {
            display: flex;
            align-items: flex-start;
            gap: 16px;
            padding: 16px;
            background: var(--bg-input);
            border-radius: 10px;
            flex-wrap: wrap;
        }

        .api-key-info, .webhook-info {
            flex: 1;
            min-width: 200px;
        }

        .api-key-name, .webhook-url {
            font-weight: 600;
            margin-bottom: 6px;
        }

        .api-key-value {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-bottom: 6px;
        }

        .api-key-value code {
            background: var(--bg-card);
            padding: 6px 10px;
            border-radius: 6px;
            font-size: 12px;
        }

        .btn-icon {
            background: none;
            border: none;
            cursor: pointer;
            font-size: 14px;
            opacity: 0.6;
        }

        .btn-icon:hover {
            opacity: 1;
        }

        .api-key-meta, .webhook-meta {
            font-size: 11px;
            color: var(--text-secondary);
        }

        .api-key-actions, .webhook-actions {
            display: flex;
            gap: 8px;
        }

        .webhook-status {
            width: 12px;
            height: 12px;
            border-radius: 50%;
            margin-top: 4px;
        }

        .webhook-status.active { background: var(--success); }
        .webhook-status.inactive { background: var(--warning); }

        .webhook-events {
            display: flex;
            gap: 6px;
            flex-wrap: wrap;
            margin-bottom: 8px;
        }

        .integration-form {
            display: flex;
            flex-direction: column;
            gap: 16px;
        }

        .mqtt-topics {
            background: var(--bg-input);
            border-radius: 10px;
            padding: 16px;
            font-size: 12px;
            margin-top: 8px;
        }

        .mqtt-topic-title {
            font-weight: 600;
            margin-bottom: 8px;
        }

        .mqtt-topics code {
            background: var(--bg-card);
            padding: 2px 6px;
            border-radius: 4px;
            font-family: 'SF Mono', Monaco, 'Consolas', monospace;
        }

        .external-services-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
            gap: 16px;
        }

        .service-card {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 16px;
            background: var(--bg-input);
            border-radius: 10px;
            border: 1px solid var(--border);
        }

        .service-card.connected {
            border-color: var(--success);
        }

        .service-icon {
            font-size: 32px;
        }

        .service-info {
            flex: 1;
        }

        .service-name {
            font-weight: 600;
        }

        .service-status {
            font-size: 12px;
            color: var(--text-secondary);
        }

        .service-card.connected .service-status {
            color: var(--success);
        }

        /* ==========================================
           EXPORT STYLES
           ========================================== */
        .export-quick-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
            gap: 16px;
        }

        .export-quick-btn {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 8px;
            padding: 24px 16px;
            background: var(--bg-input);
            border: 2px solid var(--border);
            border-radius: 12px;
            cursor: pointer;
            transition: all 0.2s;
        }

        .export-quick-btn:hover {
            border-color: var(--primary);
            background: rgba(59, 130, 246, 0.1);
        }

        .export-quick-icon {
            font-size: 32px;
        }

        .export-quick-label {
            font-weight: 600;
        }

        .export-quick-format {
            font-size: 11px;
            padding: 2px 8px;
            background: var(--bg-card);
            border-radius: 4px;
            color: var(--text-secondary);
        }

        .export-form {
            display: flex;
            flex-direction: column;
            gap: 20px;
        }

        .export-checkboxes {
            display: flex;
            flex-wrap: wrap;
            gap: 16px;
        }

        .checkbox-item {
            display: flex;
            align-items: center;
            gap: 8px;
            cursor: pointer;
            font-size: 14px;
        }

        .checkbox-item input[type="checkbox"] {
            width: 18px;
            height: 18px;
            accent-color: var(--primary);
        }

        .export-preview {
            background: var(--bg-input);
            border-radius: 10px;
            overflow: hidden;
            margin-top: 16px;
        }

        .export-preview-header {
            display: flex;
            justify-content: space-between;
            padding: 12px 16px;
            background: var(--bg-card);
            font-size: 12px;
            font-weight: 600;
        }

        .export-preview-size {
            color: var(--text-secondary);
            font-weight: normal;
        }

        .export-preview-content {
            padding: 16px;
            font-family: 'SF Mono', Monaco, 'Consolas', monospace;
            font-size: 11px;
            overflow-x: auto;
            white-space: pre;
            color: var(--text-secondary);
        }

        .scheduled-exports-list {
            display: flex;
            flex-direction: column;
            gap: 12px;
        }

        .scheduled-export-item {
            display: flex;
            align-items: center;
            gap: 16px;
            padding: 16px;
            background: var(--bg-input);
            border-radius: 10px;
            flex-wrap: wrap;
        }

        .scheduled-export-info {
            flex: 1;
            min-width: 200px;
        }

        .scheduled-export-name {
            font-weight: 600;
            margin-bottom: 4px;
        }

        .scheduled-export-meta {
            font-size: 12px;
            color: var(--text-secondary);
        }

        .scheduled-export-status {
            font-size: 12px;
            padding: 4px 12px;
            border-radius: 20px;
        }

        .scheduled-export-status.active {
            background: rgba(34, 197, 94, 0.2);
            color: var(--success);
        }

        .scheduled-export-status.paused {
            background: rgba(245, 158, 11, 0.2);
            color: var(--warning);
        }

        .scheduled-export-actions {
            display: flex;
            gap: 8px;
        }

        /* ==========================================
           THEME TOGGLE STYLES
           ========================================== */
        .theme-toggle-container {
            display: flex;
            justify-content: center;
            margin-bottom: 12px;
        }

        .theme-toggle-btn {
            width: 100%;
            padding: 10px;
            background: var(--bg-input);
            border: 1px solid var(--border);
            border-radius: 8px;
            cursor: pointer;
            font-size: 20px;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
        }

        .theme-toggle-btn:hover {
            background: var(--bg-card);
            border-color: var(--primary);
        }

        .theme-toggle-btn::after {
            content: 'Tmavý režim';
            font-size: 12px;
        }

        body.light-mode .theme-toggle-btn::after {
            content: 'Světlý režim';
        }

        /* Light mode variables */
        body.light-mode {
            --bg-dark: #f8fafc;
            --bg-card: #ffffff;
            --bg-input: #f1f5f9;
            --border: #e2e8f0;
            --text-primary: #1e293b;
            --text-secondary: #64748b;
        }

        body.light-mode .sidebar {
            background: #ffffff;
            border-right: 1px solid var(--border);
        }

        body.light-mode .main-content {
            background: #f1f5f9;
        }

        body.light-mode .card {
            box-shadow: 0 1px 3px rgba(0,0,0,0.1);
        }

        body.light-mode .device-card {
            box-shadow: 0 1px 3px rgba(0,0,0,0.1);
        }

        body.light-mode .log-entry:hover {
            background: #f8fafc;
        }

        body.light-mode .btn-secondary {
            background: #e2e8f0;
            color: #1e293b;
        }

        body.light-mode .btn-secondary:hover {
            background: #cbd5e1;
        }

        body.light-mode input,
        body.light-mode select {
            background: #ffffff;
            border-color: #cbd5e1;
            color: #1e293b;
        }

        body.light-mode .nav-item:hover {
            background: rgba(59, 130, 246, 0.1);
        }

        body.light-mode .badge-secondary {
            background: #e2e8f0;
            color: #475569;
        }

        /* ==========================================
           PLAN / PRICING STYLES
           ========================================== */
        .plan-card:hover {
            transform: translateY(-4px);
            box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
        }

        .plan-card:hover button {
            filter: brightness(1.1);
        }

        /* ==========================================
           RETROSPECTIVE STYLES
           ========================================== */
        .retro-timeline-container {
            margin-bottom: 20px;
        }

        .retro-current-time {
            text-align: center;
            font-size: 48px;
            font-weight: 700;
            font-family: 'SF Mono', Monaco, 'Consolas', monospace;
            color: var(--warning);
            margin-bottom: 16px;
            text-shadow: 0 0 20px rgba(245, 158, 11, 0.3);
        }

        .retro-timeline {
            padding: 0 10px;
        }

        .retro-timeline-track {
            position: relative;
            height: 24px;
            background: var(--bg-input);
            border-radius: 12px;
            cursor: pointer;
        }

        .retro-timeline-progress {
            position: absolute;
            top: 0;
            left: 0;
            height: 100%;
            background: linear-gradient(90deg, var(--warning), var(--primary));
            border-radius: 12px;
            transition: width 0.1s linear;
        }

        .retro-timeline-marker {
            position: absolute;
            top: -4px;
            width: 4px;
            height: 32px;
            background: white;
            border-radius: 2px;
            transform: translateX(-50%);
            box-shadow: 0 0 10px rgba(255,255,255,0.5);
            transition: left 0.1s linear;
        }

        .retro-event-marker {
            position: absolute;
            top: 50%;
            transform: translate(-50%, -50%);
            width: 8px;
            height: 8px;
            border-radius: 50%;
            z-index: 5;
        }

        .retro-event-marker.alarm { background: var(--danger); }
        .retro-event-marker.warning { background: var(--warning); }
        .retro-event-marker.info { background: var(--primary); }

        .retro-timeline-labels {
            display: flex;
            justify-content: space-between;
            margin-top: 8px;
            font-size: 11px;
            color: var(--text-secondary);
        }

        .retro-controls {
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 8px;
            flex-wrap: wrap;
        }

        .retro-state-grid {
            display: grid;
            grid-template-columns: 1fr 1.2fr 1fr;
            gap: 24px;
        }

        @media (max-width: 1024px) {
            .retro-state-grid {
                grid-template-columns: 1fr;
            }
        }

        .retro-values {
            display: flex;
            flex-direction: column;
            gap: 12px;
        }

        .retro-value-card {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 12px;
            background: var(--bg-input);
            border-radius: 10px;
        }

        .retro-value-icon {
            font-size: 28px;
        }

        .retro-value-info {
            flex: 1;
        }

        .retro-value-label {
            font-size: 11px;
            color: var(--text-secondary);
            margin-bottom: 2px;
        }

        .retro-value-number {
            font-size: 20px;
            font-weight: 700;
            font-family: 'SF Mono', Monaco, 'Consolas', monospace;
        }

        .retro-value-number.hot { color: var(--danger); }
        .retro-value-number.water { color: var(--water); }

        .retro-mini-schema {
            background: var(--bg-input);
            border-radius: 12px;
            padding: 20px;
            display: flex;
            flex-direction: column;
            gap: 20px;
        }

        .retro-boilers {
            display: flex;
            justify-content: center;
            gap: 30px;
        }

        .retro-boiler {
            text-align: center;
        }

        .retro-boiler-label {
            font-size: 12px;
            font-weight: 600;
            margin-bottom: 6px;
        }

        .retro-boiler-power {
            font-size: 18px;
            font-weight: 700;
            color: var(--danger);
            margin-bottom: 8px;
        }

        .retro-boiler-bar {
            width: 50px;
            height: 80px;
            background: var(--bg-card);
            border-radius: 8px;
            position: relative;
            overflow: hidden;
            margin: 0 auto;
        }

        .retro-boiler-fill {
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            background: linear-gradient(to top, var(--danger), var(--warning));
            transition: height 0.3s ease;
        }

        .retro-modes {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .retro-mode-item {
            display: flex;
            justify-content: space-between;
            font-size: 13px;
            padding: 8px 12px;
            background: var(--bg-card);
            border-radius: 6px;
        }

        .retro-mode-value {
            font-weight: 600;
        }

        .retro-alarms {
            background: var(--bg-input);
            border-radius: 12px;
            padding: 16px;
        }

        .retro-alarm-title {
            font-size: 12px;
            font-weight: 600;
            color: var(--text-secondary);
            margin-bottom: 12px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .retro-alarm-list {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .retro-alarm-item {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 10px;
            background: var(--bg-card);
            border-radius: 8px;
            font-size: 12px;
        }

        .retro-alarm-item.active {
            background: rgba(239, 68, 68, 0.15);
            border: 1px solid rgba(239, 68, 68, 0.3);
        }

        .retro-alarm-icon {
            font-size: 18px;
        }

        .retro-alarm-text {
            flex: 1;
        }

        .retro-alarm-time {
            font-size: 10px;
            color: var(--text-secondary);
        }

        .retro-no-alarms {
            padding: 20px;
            text-align: center;
            color: var(--text-secondary);
        }

        .retro-chart {
            background: var(--bg-input);
            border-radius: 12px;
            padding: 16px;
        }

        .retro-chart svg {
            width: 100%;
            height: 200px;
        }

        .retro-chart-legend {
            display: flex;
            justify-content: center;
            gap: 24px;
            margin-top: 12px;
            font-size: 12px;
            color: var(--text-secondary);
        }

        .retro-events-list {
            max-height: 300px;
            overflow-y: auto;
        }

        .retro-event-row {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 10px 12px;
            border-bottom: 1px solid var(--border);
        }

        .retro-event-row:last-child {
            border-bottom: none;
        }

        .retro-event-row:hover {
            background: var(--bg-input);
            cursor: pointer;
        }

        .retro-event-time {
            font-family: 'SF Mono', Monaco, 'Consolas', monospace;
            font-size: 12px;
            color: var(--text-secondary);
            min-width: 70px;
        }

        .retro-event-icon {
            font-size: 16px;
        }

        .retro-event-icon.alarm { color: var(--danger); }
        .retro-event-icon.warning { color: var(--warning); }
        .retro-event-icon.info { color: var(--primary); }
        .retro-event-icon.success { color: var(--success); }

        .retro-event-text {
            flex: 1;
            font-size: 13px;
        }

        /* ==========================================
           APPLICATION UPLOAD STYLES
           ========================================== */
        .app-container {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 20px;
        }

        .app-input-section {
            display: flex;
            flex-direction: column;
            gap: 16px;
        }

        .app-drop-zone {
            border: 2px dashed var(--border);
            border-radius: 12px;
            padding: 30px;
            text-align: center;
            cursor: pointer;
            transition: all 0.2s;
        }

        .app-drop-zone:hover,
        .app-drop-zone.dragover {
            border-color: var(--app);
            background: rgba(139, 92, 246, 0.1);
        }

        .app-drop-icon {
            font-size: 40px;
            margin-bottom: 12px;
        }

        .app-drop-text {
            color: var(--text-secondary);
            font-size: 13px;
        }

        .app-textarea {
            width: 100%;
            height: 300px;
            background: var(--bg-input);
            border: 1px solid var(--border);
            border-radius: 8px;
            padding: 14px;
            color: var(--text-primary);
            font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
            font-size: 12px;
            resize: vertical;
        }

        .app-output-section {
            display: flex;
            flex-direction: column;
            gap: 16px;
        }

        .app-output {
            background: var(--bg-input);
            border-radius: 8px;
            padding: 14px;
            height: 300px;
            overflow-y: auto;
            font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
            font-size: 12px;
        }

        .app-output-line {
            padding: 3px 0;
            border-bottom: 1px solid rgba(255,255,255,0.05);
        }

        .app-output-line.success { color: var(--success); }
        .app-output-line.error { color: var(--danger); }
        .app-output-line.info { color: var(--primary); }

        .app-stats {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 12px;
        }

        .app-stat {
            background: var(--bg-input);
            border-radius: 8px;
            padding: 12px;
            text-align: center;
        }

        .app-stat-value {
            font-size: 22px;
            font-weight: 700;
            font-family: 'SF Mono', monospace;
        }

        .app-stat-label {
            font-size: 10px;
            color: var(--text-secondary);
            text-transform: uppercase;
        }

        .app-progress-container {
            margin-top: 16px;
        }

        .app-progress-bar {
            height: 8px;
            background: var(--bg-input);
            border-radius: 4px;
            overflow: hidden;
            margin-bottom: 8px;
        }

        .app-progress-fill {
            height: 100%;
            background: var(--app);
            border-radius: 4px;
            transition: width 0.3s;
        }

        .app-progress-text {
            display: flex;
            justify-content: space-between;
            font-size: 12px;
            color: var(--text-secondary);
        }

        /* Form Footer */
        .form-footer {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-top: 20px;
            padding-top: 16px;
            border-top: 1px solid var(--border);
        }

        .status-indicator {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 13px;
            color: var(--text-secondary);
        }

        .status-dot {
            width: 10px;
            height: 10px;
            border-radius: 50%;
            background: var(--success);
        }

        /* ==========================================
           MOBILE RESPONSIVE
           ========================================== */
        @media (max-width: 1024px) {
            .viz-grid {
                grid-template-columns: 1fr;
            }

            .viz-left-panel, .viz-right-panel {
                display: grid;
                grid-template-columns: repeat(2, 1fr);
            }

            .app-container {
                grid-template-columns: 1fr;
            }

            .dhw-container {
                grid-template-columns: 1fr;
            }
        }

        @media (max-width: 768px) {
            .sidebar {
                transform: translateX(-100%);
            }

            .sidebar.open {
                transform: translateX(0);
            }

            .sidebar-close {
                display: flex;
            }

            .sidebar-overlay.open {
                display: block;
            }

            .main-content {
                margin-left: 0;
            }

            .main-header {
                display: flex;
            }

            .content-wrapper {
                padding: 12px;
            }

            .viz-left-panel, .viz-right-panel {
                grid-template-columns: 1fr;
            }

            .schedule-slot {
                grid-template-columns: 1fr;
                gap: 10px;
            }

            .water-info-panel {
                grid-template-columns: 1fr;
            }

            .app-stats {
                grid-template-columns: repeat(2, 1fr);
            }

            .equitherm-controls {
                grid-template-columns: 1fr;
            }

            .alarm-grid {
                grid-template-columns: repeat(2, 1fr);
            }
        }

        /* ==========================================
           REGULATOR SWITCHER (SSO)
           ========================================== */
        .regulator-switcher {
            margin: 0 10px 16px 10px;
            position: relative;
        }

        .regulator-current {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 12px;
            background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
            border-radius: 12px;
            cursor: pointer;
            transition: all 0.2s;
        }

        .regulator-current:hover {
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
        }

        .regulator-current-icon {
            font-size: 24px;
        }

        .regulator-current-info {
            flex: 1;
            min-width: 0;
        }

        .regulator-current-name {
            font-weight: 600;
            font-size: 14px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .regulator-current-org {
            font-size: 11px;
            opacity: 0.8;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .regulator-current-arrow {
            font-size: 10px;
            opacity: 0.7;
            transition: transform 0.2s;
        }

        .regulator-dropdown {
            position: absolute;
            top: 100%;
            left: 0;
            right: 0;
            margin-top: 4px;
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: 12px;
            box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
            z-index: 100;
            opacity: 0;
            visibility: hidden;
            transform: translateY(-10px);
            transition: all 0.2s;
        }

        .regulator-dropdown.show {
            opacity: 1;
            visibility: visible;
            transform: translateY(0);
        }

        .regulator-dropdown-header {
            padding: 10px 14px;
            font-size: 11px;
            font-weight: 600;
            color: var(--text-secondary);
            text-transform: uppercase;
            letter-spacing: 0.5px;
            border-bottom: 1px solid var(--border);
        }

        .regulator-dropdown-item {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 10px 14px;
            cursor: pointer;
            transition: background 0.15s;
        }

        .regulator-dropdown-item:hover {
            background: var(--bg-input);
        }

        .regulator-dropdown-item.offline {
            opacity: 0.6;
        }

        .regulator-item-status {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: var(--secondary);
        }

        .regulator-item-status.online {
            background: var(--success);
        }

        .regulator-item-status.offline {
            background: var(--danger);
        }

        .regulator-item-info {
            flex: 1;
            min-width: 0;
        }

        .regulator-item-name {
            font-size: 13px;
            font-weight: 500;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .regulator-item-org {
            font-size: 11px;
            color: var(--text-secondary);
        }

        .regulator-dropdown-empty {
            padding: 16px 14px;
            text-align: center;
            color: var(--text-secondary);
            font-size: 12px;
        }

        .regulator-dropdown-footer {
            padding: 10px 14px;
            border-top: 1px solid var(--border);
        }

        .regulator-back-link {
            display: block;
            text-align: center;
            color: var(--primary);
            text-decoration: none;
            font-size: 12px;
            padding: 6px;
            border-radius: 6px;
            transition: background 0.15s;
        }

        .regulator-back-link:hover {
            background: rgba(37, 99, 235, 0.1);
        }

        /* SSO Badge */
        .sso-badge {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            padding: 2px 8px;
            background: rgba(37, 99, 235, 0.15);
            color: var(--primary);
            border-radius: 10px;
            font-size: 10px;
            font-weight: 600;
        }

        /* Light mode adjustments */
        body.light-mode .regulator-dropdown {
            box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
        }
