* {
                margin: 0;
                padding: 0;
                box-sizing: border-box;
            }

            html, body {
                height: 100%;
            }

            body {
                font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
                background-color: var(--app-bg);
                color: var(--app-text);
            }

            :root {
                --app-bg: #f8f9fa;
                --app-surface: #ffffff;
                --app-text: #2c3e50;
                --app-muted: #6c757d;
                --app-border: #e9ecef;
                --app-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
                --app-primary: #c92a2a;
                --app-bg-card: #ffffff;
                --app-bg-hover: #f1f3f5;
            }

            [data-theme="dark"] {
                --app-bg: #0f1117;
                --app-surface: #161b26;
                --app-text: #e6e9ef;
                --app-muted: #a4adbd;
                --app-border: #252d3a;
                --app-shadow: 0 0 0 1px rgba(148, 163, 184, 0.16), 0 10px 30px rgba(0, 0, 0, 0.35);
                --app-primary: #c92a2a;
                --app-bg-card: #161b26;
                --app-bg-hover: #1e2535;
            }

            .layout-wrapper {
                display: flex;
                min-height: 100vh;
            }

            body:not(.authenticated) .layout-wrapper {
                min-height: auto;
                height: auto;
            }

            /* Sidebar */
            header {
                position: fixed;
                left: 0;
                top: 0;
                width: 280px;
                height: 100vh;
                background: var(--app-surface);
                border-right: 1px solid var(--app-border);
                overflow-y: auto;
                z-index: 100;
            }

            /* Main Content Area */
            main {
                margin-left: 280px;
                width: calc(100% - 280px);
                min-height: 100vh;
                padding: 2rem;
                background-color: var(--app-bg);
                display: flex;
                flex-direction: column;
            }

            /* Se não houver autenticação, a main ocupa toda a tela */
            body:not(.authenticated) main {
                margin-left: 0;
                width: 100%;
                min-height: auto;
                padding: 0;
                background-color: transparent;
            }

            .main-content {
                max-width: 1400px;
                margin: 0 auto;
                width: 100%;
            }

            h1, h2, h3 {
                color: var(--app-text);
            }

            .btn-primary {
                background-color: #c92a2a;
                color: white;
                padding: 0.75rem 1.5rem;
                border: none;
                border-radius: 8px;
                cursor: pointer;
                text-decoration: none;
                display: inline-flex;
                align-items: center;
                gap: 0.5rem;
                font-weight: 600;
                transition: all 0.3s ease;
            }

            .btn-primary i {
                font-size: 0.9rem;
            }

            .btn-primary:hover {
                background-color: #a01c1c;
                box-shadow: 0 2px 8px rgba(201, 42, 42, 0.2);
            }

            .form-input {
                width: 100%;
                padding: 0.75rem;
                border: 1px solid var(--app-border);
                border-radius: 8px;
                font-size: 1rem;
                font-family: inherit;
                transition: all 0.3s ease;
                background-color: var(--app-surface);
                color: var(--app-text);
                box-sizing: border-box;
            }

            .form-input:focus {
                outline: none;
                border-color: #c92a2a;
                box-shadow: 0 0 0 3px rgba(201, 42, 42, 0.1);
            }

            textarea.form-input {
                resize: vertical;
                min-height: 120px;
            }

            /* FontAwesome Icons - Explicit Support */
            i[class*="fa-"] {
                display: inline-block;
                font-family: "Font Awesome 6 Free", "Font Awesome 6 Pro";
                font-weight: 900;
                font-style: normal;
                font-variant: normal;
                text-rendering: auto;
                -webkit-font-smoothing: antialiased;
                -moz-osx-font-smoothing: grayscale;
            }

            i.fa-solid {
                font-family: "Font Awesome 6 Free";
                font-weight: 900;
            }

            i.fa-regular {
                font-family: "Font Awesome 6 Free";
                font-weight: 400;
            }

            i.fa-brands {
                font-family: "Font Awesome 6 Brands";
                font-weight: 400;
            }

            /* Mobile: Sidebar collapses */
            @media (max-width: 768px) {
                header {
                    width: 70px;
                }

                main {
                    margin-left: 70px;
                    width: calc(100% - 70px);
                    padding: 1rem;
                }

                main .main-content {
                    max-width: none;
                }
            }

            @media (max-width: 480px) {
                header {
                    width: 60px;
                }

                main {
                    margin-left: 60px;
                    width: calc(100% - 60px);
                    padding: 0.5rem;
                }
            }