/* ===== RESET E VARIÁVEIS ===== */
        :root {
            --primary-color: #2563eb;
            --secondary-color: #0ea5e9;
            --success-color: #10b981;
            --warning-color: #f59e0b;
            --danger-color: #dc2626;
            --dark-color: #1e293b;
            --light-color: #f8fafc;
            --gray-color: #64748b;
            --border-radius: 8px;
            --box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
            --transition: all 0.3s ease;
        }
        
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        
        body {
            font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
            background-color: #0f172a;
            color: #e2e8f0;
            line-height: 1.6;
            min-height: 100vh;
        }
        
        /* ===== LAYOUT PRINCIPAL ===== */
        .app-container {
            display: flex;
            min-height: 100vh;
        }
        
        /* ===== SIDEBAR (COMUM A TODAS AS TELAS) ===== */
        .sidebar {
            width: 240px;
            background-color: #1e293b;
            padding: 1.5rem;
            display: flex;
            flex-direction: column;
            border-right: 1px solid #334155;
            position: fixed;
            height: 100vh;
            z-index: 100;
        }
        
        .logo {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            margin-bottom: 2rem;
            padding-bottom: 1rem;
            border-bottom: 1px solid #334155;
            text-decoration: none;
        }
        
        .logo-icon {
            color: var(--primary-color);
            font-size: 1.75rem;
        }
        
        .logo-text {
            font-size: 1.5rem;
            font-weight: 700;
            background: linear-gradient(90deg, #2563eb, #0ea5e9);
            -webkit-background-clip: text;
            background-clip: text;
            color: transparent;
        }
        
        .nav-menu {
            flex: 1;
        }
        
        .nav-item {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            padding: 0.75rem 1rem;
            margin-bottom: 0.5rem;
            border-radius: var(--border-radius);
            text-decoration: none;
            color: #cbd5e1;
            transition: var(--transition);
            cursor: pointer;
        }
        
        .nav-item:hover {
            background-color: #334155;
            color: white;
        }
        
        .nav-item.active {
            background-color: var(--primary-color);
            color: white;
        }
        
        .nav-icon {
            width: 20px;
            text-align: center;
        }
        
        .system-status {
            background-color: #1e293b;
            border: 1px solid #334155;
            border-radius: var(--border-radius);
            padding: 1rem;
            margin-top: 1rem;
        }
        
        .status-indicator {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            font-size: 0.875rem;
        }
        
        .status-dot {
            width: 10px;
            height: 10px;
            border-radius: 50%;
            background-color: var(--success-color);
            animation: pulse 2s infinite;
        }
        
        @keyframes pulse {
            0% { opacity: 1; }
            50% { opacity: 0.5; }
            100% { opacity: 1; }
        }
        
        /* ===== CONTEÚDO PRINCIPAL ===== */
        .main-content {
            flex: 1;
            padding: 1.5rem;
            margin-left: 240px;
            width: calc(100% - 240px);
        }
        
        /* ===== HEADER (COMUM) ===== */
        .header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 2rem;
            padding-bottom: 1rem;
            border-bottom: 1px solid #334155;
        }
        
        .header-title h1 {
            font-size: 1.75rem;
            font-weight: 700;
        }
        
        .header-title p {
            color: #94a3b8;
            font-size: 0.875rem;
        }
        
        .header-actions {
            display: flex;
            gap: 1rem;
            align-items: center;
        }
        
        .time-display {
            background-color: #1e293b;
            padding: 0.5rem 1rem;
            border-radius: var(--border-radius);
            border: 1px solid #334155;
            font-size: 0.875rem;
        }
        
        .btn {
            padding: 0.5rem 1rem;
            border-radius: var(--border-radius);
            border: none;
            cursor: pointer;
            font-weight: 600;
            transition: var(--transition);
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
        }
        
        .btn-primary {
            background-color: var(--primary-color);
            color: white;
        }
        
        .btn-primary:hover {
            background-color: #1d4ed8;
        }
        
        .btn-secondary {
            background-color: #334155;
            color: white;
        }
        
        .btn-secondary:hover {
            background-color: #475569;
        }
        
        .btn-success {
            background-color: var(--success-color);
            color: white;
        }
        
        .btn-danger {
            background-color: var(--danger-color);
            color: white;
        }
        
        /* ===== COMPONENTES REUTILIZÁVEIS ===== */
        .kpi-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
            gap: 1rem;
            margin-bottom: 2rem;
        }
        
        .kpi-card {
            background-color: #1e293b;
            border-radius: var(--border-radius);
            padding: 1.5rem;
            border: 1px solid #334155;
            transition: var(--transition);
        }
        
        .kpi-card:hover {
            transform: translateY(-4px);
            box-shadow: var(--box-shadow);
        }
        
        .kpi-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1rem;
        }
        
        .kpi-title {
            font-size: 0.875rem;
            color: #94a3b8;
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }
        
        .kpi-icon {
            font-size: 1.25rem;
            color: var(--primary-color);
        }
        
        .kpi-value {
            font-size: 2rem;
            font-weight: 700;
            margin-bottom: 0.5rem;
        }
        
        .kpi-trend {
            display: flex;
            align-items: center;
            gap: 0.25rem;
            font-size: 0.875rem;
        }
        
        .trend-up {
            color: var(--success-color);
        }
        
        .trend-down {
            color: var(--danger-color);
        }
        
        .section-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1.5rem;
        }
        
        .section-title {
            font-size: 1.25rem;
            font-weight: 600;
        }
        
        .badge {
            padding: 0.25rem 0.75rem;
            border-radius: 9999px;
            font-size: 0.75rem;
            font-weight: 600;
        }
        
        .badge-critical {
            background-color: rgba(220, 38, 38, 0.1);
            color: var(--danger-color);
            border: 1px solid rgba(220, 38, 38, 0.3);
        }
        
        .badge-warning {
            background-color: rgba(245, 158, 11, 0.1);
            color: var(--warning-color);
            border: 1px solid rgba(245, 158, 11, 0.3);
        }
        
        .badge-success {
            background-color: rgba(16, 185, 129, 0.1);
            color: var(--success-color);
            border: 1px solid rgba(16, 185, 129, 0.3);
        }
        
        .card {
            background-color: #1e293b;
            border-radius: var(--border-radius);
            border: 1px solid #334155;
            padding: 1.5rem;
            margin-bottom: 1.5rem;
        }
        
        .table-container {
            overflow-x: auto;
            border-radius: var(--border-radius);
            border: 1px solid #334155;
        }
        
        table {
            width: 100%;
            border-collapse: collapse;
        }
        
        th {
            background-color: #1e293b;
            padding: 1rem;
            text-align: left;
            font-weight: 600;
            color: #94a3b8;
            border-bottom: 1px solid #334155;
        }
        
        td {
            padding: 1rem;
            border-bottom: 1px solid #334155;
        }
        
        tr:hover {
            background-color: rgba(30, 41, 59, 0.5);
        }
        
        .form-group {
            margin-bottom: 1.5rem;
        }
        
        .form-label {
            display: block;
            margin-bottom: 0.5rem;
            font-weight: 600;
            color: #cbd5e1;
        }
        
        .form-control {
            width: 100%;
            padding: 0.75rem 1rem;
            background-color: #1e293b;
            border: 1px solid #334155;
            border-radius: var(--border-radius);
            color: white;
            font-size: 1rem;
        }
        
        .form-control:focus {
            outline: none;
            border-color: var(--primary-color);
        }
        
        .form-row {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 1rem;
        }
        
        .modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.7);
            z-index: 1000;
            align-items: center;
            justify-content: center;
        }
        
        .modal-content {
            background-color: #1e293b;
            border-radius: var(--border-radius);
            border: 1px solid #334155;
            width: 90%;
            max-width: 600px;
            max-height: 90vh;
            overflow-y: auto;
        }
        
        .modal-header {
            padding: 1.5rem;
            border-bottom: 1px solid #334155;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        
        .modal-body {
            padding: 1.5rem;
        }
        
        .modal-footer {
            padding: 1.5rem;
            border-top: 1px solid #334155;
            display: flex;
            justify-content: flex-end;
            gap: 1rem;
        }
        
        .close-modal {
            background: none;
            border: none;
            color: #94a3b8;
            font-size: 1.5rem;
            cursor: pointer;
        }
        
        /* ===== ESTILOS ESPECÍFICOS POR TELA ===== */
        
        /* TELA: DASHBOARD */
        .alerts-list {
            display: flex;
            flex-direction: column;
            gap: 0.75rem;
        }
        
        .alert-item {
            display: flex;
            align-items: center;
            gap: 1rem;
            padding: 1rem;
            background-color: rgba(30, 41, 59, 0.5);
            border-radius: var(--border-radius);
            border-left: 4px solid var(--danger-color);
        }
        
        .alert-critical {
            border-left-color: var(--danger-color);
        }
        
        .alert-warning {
            border-left-color: var(--warning-color);
        }
        
        .alert-info {
            border-left-color: var(--secondary-color);
        }
        
        .alert-icon {
            font-size: 1.25rem;
        }
        
        .alert-critical .alert-icon {
            color: var(--danger-color);
        }
        
        .alert-content {
            flex: 1;
        }
        
        .alert-title {
            font-weight: 600;
            margin-bottom: 0.25rem;
        }
        
        .alert-description {
            font-size: 0.875rem;
            color: #94a3b8;
        }
        
        .alert-time {
            font-size: 0.75rem;
            color: #64748b;
        }
        
        .devices-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            gap: 1rem;
            margin-bottom: 2rem;
        }
        
        .device-card {
            background-color: #1e293b;
            border-radius: var(--border-radius);
            border: 1px solid #334155;
            padding: 1.5rem;
        }
        
        .device-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1rem;
        }
        
        .device-name {
            font-weight: 600;
            font-size: 1.125rem;
        }
        
        .device-status {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            font-size: 0.875rem;
        }
        
        .status-online {
            color: var(--success-color);
        }
        
        .status-offline {
            color: var(--danger-color);
        }
        
        .device-metrics {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 1rem;
            margin-top: 1rem;
        }
        
        .metric {
            display: flex;
            flex-direction: column;
        }
        
        .metric-label {
            font-size: 0.75rem;
            color: #94a3b8;
            margin-bottom: 0.25rem;
        }
        
        .metric-value {
            font-weight: 600;
            font-size: 1.125rem;
        }
        
        .chart-placeholder {
            height: 300px;
            display: flex;
            align-items: center;
            justify-content: center;
            background-color: rgba(30, 41, 59, 0.5);
            border-radius: var(--border-radius);
            margin-top: 1rem;
            color: #64748b;
        }
        
        /* TELA: DISPOSITIVOS */
        .device-actions {
            display: flex;
            gap: 0.5rem;
        }
        
        .action-btn {
            padding: 0.25rem 0.5rem;
            border-radius: 4px;
            border: none;
            background: none;
            cursor: pointer;
            color: #94a3b8;
        }
        
        .action-btn:hover {
            background-color: #334155;
            color: white;
        }
        
        /* TELA: ALERTAS */
        .filter-bar {
            display: flex;
            gap: 0.5rem;
            margin-bottom: 1.5rem;
        }
        
        .filter-btn {
            padding: 0.5rem 1rem;
            border-radius: var(--border-radius);
            border: 1px solid #334155;
            background: none;
            color: #94a3b8;
            cursor: pointer;
        }
        
        .filter-btn.active {
            background-color: var(--primary-color);
            border-color: var(--primary-color);
            color: white;
        }
        
        /* TELA: ANÁLISE */
        .time-range-selector {
            display: flex;
            gap: 0.5rem;
            margin-bottom: 1.5rem;
        }
        
        .time-btn {
            padding: 0.5rem 1rem;
            border-radius: var(--border-radius);
            border: 1px solid #334155;
            background: none;
            color: #94a3b8;
            cursor: pointer;
        }
        
        .time-btn.active {
            background-color: var(--primary-color);
            border-color: var(--primary-color);
            color: white;
        }
        
        /* TELA: CONFIGURAÇÕES */
        .settings-nav {
            display: flex;
            border-bottom: 1px solid #334155;
            margin-bottom: 1.5rem;
        }
        
        .settings-tab {
            padding: 0.75rem 1.5rem;
            background: none;
            border: none;
            color: #94a3b8;
            cursor: pointer;
            border-bottom: 3px solid transparent;
        }
        
        .settings-tab.active {
            color: var(--primary-color);
            border-bottom-color: var(--primary-color);
        }
        
        .settings-section {
            display: none;
        }
        
        .settings-section.active {
            display: block;
        }
        
        .toggle-switch {
            position: relative;
            display: inline-block;
            width: 60px;
            height: 30px;
        }
        
        .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: #334155;
            transition: .4s;
            border-radius: 34px;
        }
        
        .toggle-slider:before {
            position: absolute;
            content: "";
            height: 22px;
            width: 22px;
            left: 4px;
            bottom: 4px;
            background-color: white;
            transition: .4s;
            border-radius: 50%;
        }
        
        input:checked + .toggle-slider {
            background-color: var(--primary-color);
        }
        
        input:checked + .toggle-slider:before {
            transform: translateX(30px);
        }
        
        /* TELA: HISTÓRICO */
        .search-bar {
            display: flex;
            gap: 1rem;
            margin-bottom: 1.5rem;
        }
        
        .search-input {
            flex: 1;
            padding: 0.75rem 1rem;
            background-color: #1e293b;
            border: 1px solid #334155;
            border-radius: var(--border-radius);
            color: white;
        }
        
        /* ===== FOOTER (COMUM) ===== */
        .footer {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding-top: 1.5rem;
            border-top: 1px solid #334155;
            font-size: 0.875rem;
            color: #94a3b8;
        }
        
        .node-info {
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }
        
        /* ===== RESPONSIVIDADE ===== */
        @media (max-width: 1024px) {
            .sidebar {
                width: 200px;
            }
            
            .main-content {
                margin-left: 200px;
                width: calc(100% - 200px);
            }
        }
        
        @media (max-width: 768px) {
            .sidebar {
                width: 100%;
                height: auto;
                position: relative;
                flex-direction: row;
                padding: 1rem;
            }
            
            .logo {
                margin-bottom: 0;
                border-bottom: none;
                border-right: 1px solid #334155;
                padding-right: 1rem;
                margin-right: 1rem;
            }
            
            .nav-menu {
                display: flex;
                gap: 0.5rem;
                overflow-x: auto;
            }
            
            .nav-item span:not(.nav-icon) {
                display: none;
            }
            
            .system-status {
                display: none;
            }
            
            .main-content {
                margin-left: 0;
                width: 100%;
            }
            
            .form-row {
                grid-template-columns: 1fr;
            }
            
            .header {
                flex-direction: column;
                align-items: flex-start;
                gap: 1rem;
            }
            
            .header-actions {
                width: 100%;
                justify-content: space-between;
            }
        }
        
        @media (max-width: 640px) {
            .kpi-grid {
                grid-template-columns: 1fr;
            }
            
            .devices-grid {
                grid-template-columns: 1fr;
            }
            
            .device-metrics {
                grid-template-columns: 1fr;
            }
        }