<!DOCTYPE html>
<html lang="pt-BR">
<head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
    <title>{% block title %}ProcessaWatt{% endblock %}</title>
    <link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>⚡️</text></svg>">
    <link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600&display=swap" rel="stylesheet">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">

    <style>
        :root {
            --primary: #2563eb;
            --primary-dark: #1e40af;
            --sidebar-width: 250px;
            --sidebar-collapsed: 80px;
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Montserrat', sans-serif;
        }

        body {
            display: flex;
            min-height: 100vh;
            background: #f8fafc;
            transition: all 0.3s;
        }

        .sidebar {
            width: var(--sidebar-collapsed);
            height: 100vh;
            background: linear-gradient(to bottom, var(--primary), var(--primary-dark));
            position: fixed;
            transition: all 0.3s;
            overflow: hidden;
        }

        .sidebar.expanded {
            width: var(--sidebar-width);
        }

        .logo-container {
            height: 80px;
            display: flex;
            align-items: center;
            padding: 0 20px;
            border-bottom: 1px solid rgba(255,255,255,0.1);
            color: white;
            gap: 15px;
            cursor: pointer;
        }

        .logo-icon {
            width: 40px;
            height: 40px;
            background: white;
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--primary);
            font-size: 1.5rem;
        }

        .app-name {
            font-weight: 600;
            font-size: 1.1rem;
            opacity: 0;
            transition: opacity 0.3s;
            white-space: nowrap;
        }

        .sidebar.expanded .app-name {
            opacity: 1;
        }

        .menu {
            padding-top: 20px;
        }

        .menu-item {
            display: flex;
            align-items: center;
            height: 50px;
            color: rgba(255,255,255,0.9);
            text-decoration: none;
            padding-left: 20px;
            transition: all 0.2s;
        }

        .menu-item:hover {
            background: rgba(255,255,255,0.1);
        }

        .menu-item i {
            font-size: 1.2rem;
            width: 24px;
        }

        .menu-item span {
            margin-left: 15px;
            opacity: 0;
            transition: opacity 0.3s;
        }

        .sidebar.expanded .menu-item span {
            opacity: 1;
        }

        .main-content {
            margin-left: var(--sidebar-collapsed);
            padding: 30px;
            flex-grow: 1;
            transition: margin-left 0.3s;
        }

        .sidebar.expanded ~ .main-content {
            margin-left: var(--sidebar-width);
        }

        .filter-section {
            margin: 20px 0;
            padding: 15px;
            background: #f8f9fa;
            border-radius: 5px;
        }

        .indicator {
            padding: 10px;
            background: #e5e7eb;
            border-radius: 4px;
            margin-bottom: 10px;
        }

        .divider {
            margin: 30px 0;
            border-top: 1px solid #eee;
        }
    </style>
</head>
<body>
    <!-- Sidebar -->
    <div class="sidebar" id="sidebar">
        <div class="logo-container" onclick="toggleSidebar()">
            <div class="logo-icon">⚡️</div>
            <div class="app-name">ProcessaWatt</div>
        </div>
        <div class="menu">
            <a href="/" class="menu-item">
                <i class="fas fa-tachometer-alt"></i>
                <span>Dashboard</span>
            </a>
            <a href="/upload" class="menu-item">
                <i class="fas fa-upload"></i>
                <span>Upload</span>
            </a>
            <a href="/relatorios" class="menu-item">
                <i class="fas fa-chart-bar"></i>
                <span>Relatórios</span>
            </a>
            <a href="/parametros" class="menu-item">
                <i class="fas fa-cog"></i>
                <span>Parâmetros</span>
            </a>
        </div>
    </div>

    <!-- Main Content -->
    <div class="main-content">
        {% block content %}
        {% endblock %}
    </div>

    <script>
        function toggleSidebar() {
            document.getElementById('sidebar').classList.toggle('expanded');
        }
    </script>
</body>
</html>
