:root {
            --sidebar-width: 70px;
            --sidebar-expanded-width: 200px;
            --sidebar-bg: #2d3748;
            --sidebar-hover: #4a5568;
            --submenu-bg: #374151;
            --submenu-width: 260px;
            --accent-color: #3b82f6;
            --accent-hover: #2563eb;
            --text-primary: #ffffff;
            --text-secondary: #9ca3af;
            --content-bg: #f3f4f6;
            --header-bg: #ffffff;
            --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
            --transition: all 0.2s ease;
        }

        [data-theme="dark"] {
            --content-bg: #1f2937;
            --header-bg: #111827;
            --text-content: #e5e7eb;
        }

        [data-theme="light"] {
            --content-bg: #f3f4f6;
            --header-bg: #ffffff;
            --text-content: #1f2937;
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
            background-color: var(--content-bg);
            overflow: hidden;
            height: 100%;
            height: 100dvh;
        }

        /* ===== SIDEBAR PRINCIPAL ===== */
        .sidebar {
            position: fixed;
            left: 0;
            top: 0;
            width: var(--sidebar-width);
            height: 100%;
            height: 100dvh;
            background: var(--sidebar-bg);
            display: flex;
            flex-direction: column;
            z-index: 1000;
            box-shadow: var(--shadow);
            overflow: hidden;
        }

        .sidebar-header {
            height: 60px;
            min-height: 60px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-bottom: 1px solid rgba(255,255,255,0.1);
            padding: 10px;
            gap: 10px;
            overflow: hidden;
            flex-shrink: 0;
        }

        .sidebar-logo {
            width: 40px;
            height: 40px;
            min-width: 40px;
            background: linear-gradient(135deg, var(--accent-color), var(--accent-hover));
            border-radius: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 20px;
            font-weight: bold;
        }

        .sidebar-title {
            font-size: 18px;
            font-weight: 700;
            color: var(--text-primary);
            white-space: nowrap;
            opacity: 0;
            width: 0;
            overflow: hidden;
            transition: var(--transition);
        }

        .sidebar.expanded .sidebar-title {
            opacity: 1;
            width: auto;
        }

        /* Menu Items Container com Scrollbar */
        .sidebar-menu {
            flex: 1;
            padding: 10px 0;
            overflow-y: auto;
            overflow-x: hidden;
            scrollbar-width: thin;
            scrollbar-color: rgba(255,255,255,0.2) transparent;
            min-height: 0;
            position: relative;
        }

        /* Scrollbar sempre visível para facilitar */
        .sidebar-menu::-webkit-scrollbar {
            width: 6px;
        }

        .sidebar-menu::-webkit-scrollbar-track {
            background: transparent;
        }

        .sidebar-menu::-webkit-scrollbar-thumb {
            background: rgba(255,255,255,0.2);
            border-radius: 3px;
            transition: background 0.3s ease;
        }

        .sidebar-menu:hover::-webkit-scrollbar-thumb {
            background: rgba(255,255,255,0.4);
        }

        .sidebar-menu::-webkit-scrollbar-thumb:hover {
            background: rgba(255,255,255,0.5);
        }

        /* Menu Item Principal */
        .menu-item {
            position: relative;
            width: 100%;
            height: 50px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: var(--transition);
            color: var(--text-secondary);
            padding: 0 15px;
            gap: 12px;
            flex-shrink: 0;
        }

        .menu-item .menu-icon {
            font-size: 20px;
            transition: var(--transition);
            min-width: 20px;
            text-align: center;
        }

        .menu-item .menu-text {
            font-size: 14px;
            font-weight: 500;
            white-space: nowrap;
            opacity: 0;
            width: 0;
            overflow: hidden;
            transition: var(--transition);
        }

        .sidebar.expanded .menu-item {
            justify-content: flex-start;
        }

        .sidebar.expanded .menu-item .menu-text {
            opacity: 1;
            width: auto;
        }

        .menu-item:hover {
            background: var(--sidebar-hover);
            color: var(--text-primary);
        }

        .menu-item.active {
            background: var(--accent-color);
            color: var(--text-primary);
        }

        .menu-item > i:first-child {
            font-size: 20px;
            transition: var(--transition);
            min-width: 20px;
            text-align: center;
        }

        .menu-item:hover > i:first-child,
        .menu-item:hover .menu-icon {
            transform: scale(1.1);
        }

        /* Sidebar Expandida */
        .sidebar.expanded {
            width: var(--sidebar-expanded-width);
        }

        .sidebar.expanded ~ .main-content {
            margin-left: var(--sidebar-expanded-width);
        }

        .sidebar.expanded .flyout-menu {
            left: var(--sidebar-expanded-width);
        }

        /* ===== FLYOUT SUBMENU (Aparece na lateral) ===== */
        .flyout-menu {
            position: fixed;
            left: var(--sidebar-width);
            width: 260px;
            min-width: 260px;
            background: var(--submenu-bg);
            border-radius: 0 8px 8px 0;
            box-shadow: 4px 4px 20px rgba(0,0,0,0.3);
            opacity: 0;
            visibility: hidden;
            transform: translateX(-10px);
            transition: all 0.15s ease-out;
            z-index: 9999;
            max-height: 80vh;
            overflow-y: auto;
            pointer-events: none;
        }

        /* Flyout aparece ao passar o mouse */
        .menu-item:hover > .flyout-menu,
        .menu-item.flyout-active > .flyout-menu {
            opacity: 1;
            visibility: visible;
            transform: translateX(0);
            pointer-events: auto;
        }

        .flyout-menu::-webkit-scrollbar {
            width: 4px;
        }

        .flyout-menu::-webkit-scrollbar-thumb {
            background: rgba(255,255,255,0.2);
            border-radius: 2px;
        }

        .flyout-header {
            padding: 15px 20px;
            border-bottom: 1px solid rgba(255,255,255,0.1);
            font-weight: 600;
            color: var(--text-primary);
            font-size: 14px;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .flyout-header i {
            color: var(--accent-color);
        }

        .flyout-item {
            display: flex;
            align-items: center;
            padding: 12px 20px;
            color: var(--text-secondary);
            cursor: pointer;
            transition: var(--transition);
            font-size: 13px;
            gap: 12px;
            border-left: 3px solid transparent;
        }

        .flyout-item:hover {
            background: rgba(255,255,255,0.1);
            color: var(--text-primary);
            border-left-color: var(--accent-color);
        }

        .flyout-item.active {
            background: rgba(59, 130, 246, 0.2);
            color: var(--accent-color);
            border-left-color: var(--accent-color);
        }

        .flyout-item i {
            width: 18px;
            font-size: 12px;
            opacity: 0.7;
        }

        /* ===== FOOTER DA SIDEBAR ===== */
        .sidebar-footer {
            padding: 8px;
            border-top: 1px solid rgba(255,255,255,0.1);
            flex-shrink: 0;
            background: var(--sidebar-bg);
            position: relative;
            z-index: 20;
        }

        .copyright-info {
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: 8px 5px;
            margin-bottom: 8px;
            font-size: 10px;
            color: var(--text-secondary);
            text-align: center;
            line-height: 1.4;
            opacity: 0.8;
        }

        .copyright-info .copyright-text {
            display: none;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            max-width: 100%;
        }

        .sidebar.expanded .copyright-info .copyright-text {
            display: block;
        }

        .license-link {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 4px;
            color: var(--accent-color);
            text-decoration: none;
            margin-top: 4px;
            font-size: 10px;
            transition: var(--transition);
        }

        .license-link .license-text {
            display: none;
        }

        .sidebar.expanded .license-link {
            flex-direction: row;
            gap: 6px;
        }

        .sidebar.expanded .license-link .license-text {
            display: inline;
        }

        .license-link:hover {
            color: var(--text-primary);
        }

        .license-img {
            height: 15px;
            width: auto;
        }

        .theme-toggle,
        .expand-toggle {
            width: 100%;
            height: 40px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            color: var(--text-secondary);
            transition: var(--transition);
            border-radius: 8px;
            gap: 12px;
            padding: 0 15px;
        }

        .sidebar.expanded .theme-toggle,
        .sidebar.expanded .expand-toggle {
            justify-content: flex-start;
        }

        .theme-toggle .menu-text,
        .expand-toggle .menu-text {
            font-size: 14px;
            font-weight: 500;
            white-space: nowrap;
            opacity: 0;
            width: 0;
            overflow: hidden;
            transition: var(--transition);
        }

        .sidebar.expanded .theme-toggle .menu-text,
        .sidebar.expanded .expand-toggle .menu-text {
            opacity: 1;
            width: auto;
        }

        .theme-toggle:hover,
        .expand-toggle:hover {
            background: var(--sidebar-hover);
            color: var(--text-primary);
        }

        .expand-toggle {
            margin-bottom: 5px;
        }

        .expand-toggle i {
            transition: transform 0.3s ease;
        }

        .sidebar.expanded .expand-toggle i {
            transform: rotate(180deg);
        }

        .theme-toggle:hover {
            background: var(--sidebar-hover);
            color: var(--text-primary);
        }

        /* ===== ÁREA DE CONTEÚDO ===== */
        .main-content {
            margin-left: var(--sidebar-width);
            height: 100vh;
            display: flex;
            flex-direction: column;
            background: var(--content-bg);
        }

        .content-header {
            height: 60px;
            background: var(--header-bg);
            display: flex;
            align-items: center;
            padding: 0 24px;
            box-shadow: var(--shadow);
            position: sticky;
            top: 0;
            z-index: 100;
        }

        .page-title {
            font-size: 18px;
            font-weight: 600;
            color: var(--text-content, #1f2937);
            display: flex;
            align-items: center;
            gap: 12px;
            flex: 1;
            min-width: 0;
        }

        .page-title span {
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .page-title i {
            color: var(--accent-color);
            flex-shrink: 0;
        }

        .header-actions {
            margin-left: auto;
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .header-btn {
            width: 36px;
            height: 36px;
            border-radius: 8px;
            border: none;
            background: transparent;
            color: var(--text-content, #6b7280);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: var(--transition);
        }

        .header-btn:hover {
            background: rgba(0,0,0,0.05);
            color: var(--accent-color);
        }

        /* ===== CONTAINER DE TABS ===== */
        .tabs-container {
            flex: 1;
            overflow: hidden;
            padding: 16px;
        }

        .tab {
            display: none;
            height: 100%;
            background: var(--header-bg);
            border-radius: 12px;
            box-shadow: var(--shadow);
            overflow: hidden;
        }

        .tab.active {
            display: block;
        }

        .tab-iframe {
            width: 100%;
            height: 100%;
            border: none;
        }

        .tab-content {
            padding: 24px;
            height: 100%;
            overflow-y: auto;
        }

        /* ===== POPUPS ===== */
        .popup-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0,0,0,0.6);
            backdrop-filter: blur(4px);
            justify-content: center;
            align-items: center;
            z-index: 9999;
        }

        .popup-content {
            background: white;
            padding: 30px;
            border-radius: 16px;
            max-width: 450px;
            width: 90%;
            box-shadow: 0 20px 40px rgba(0,0,0,0.3);
            animation: popupIn 0.3s ease;
        }

        @keyframes popupIn {
            from {
                opacity: 0;
                transform: scale(0.9) translateY(20px);
            }
            to {
                opacity: 1;
                transform: scale(1) translateY(0);
            }
        }

        .popup-title {
            font-size: 18px;
            font-weight: 600;
            margin-bottom: 15px;
            color: #1f2937;
        }

        .popup-text {
            color: #6b7280;
            line-height: 1.6;
            margin-bottom: 20px;
        }

        .popup-buttons {
            display: flex;
            gap: 12px;
            justify-content: flex-end;
        }

        .btn {
            padding: 10px 20px;
            border-radius: 8px;
            font-weight: 500;
            cursor: pointer;
            transition: var(--transition);
            border: none;
            font-size: 14px;
        }

        .btn-primary {
            background: var(--accent-color);
            color: white;
        }

        .btn-primary:hover {
            background: var(--accent-hover);
        }

        .btn-secondary {
            background: #f3f4f6;
            color: #374151;
        }

        .btn-secondary:hover {
            background: #e5e7eb;
        }

        /* ===== MOBILE ===== */
        @media (max-width: 768px) {
            .sidebar {
                transform: translateX(-100%);
                transition: transform 0.3s ease;
            }

            .sidebar.mobile-open {
                transform: translateX(0);
            }

            .main-content {
                margin-left: 0;
            }

            .mobile-menu-btn {
                display: flex !important;
            }

            .flyout-menu {
                position: fixed;
                left: var(--sidebar-width);
                width: calc(100vw - var(--sidebar-width));
                max-width: 280px;
            }

            .content-header {
                padding: 0 12px;
            }

            .page-title {
                font-size: 14px;
            }

            .page-title span {
                max-width: 200px;
                overflow: hidden;
                text-overflow: ellipsis;
                white-space: nowrap;
            }

            .tabs-container {
                padding: 8px;
            }

            .popup-content {
                width: 95%;
                padding: 20px;
            }
        }

        /* ===== TABLETS E NOTEBOOKS PEQUENOS ===== */
        @media (max-width: 1024px) {
            :root {
                --sidebar-expanded-width: 180px;
            }

            .page-title {
                font-size: 15px;
            }

            .page-title span {
                max-width: 350px;
                overflow: hidden;
                text-overflow: ellipsis;
                white-space: nowrap;
            }

            .tabs-container {
                padding: 12px;
            }

            .flyout-menu {
                width: 240px;
                min-width: 240px;
            }

            .flyout-item {
                padding: 10px 15px;
                font-size: 12px;
            }

            .flyout-header {
                padding: 12px 15px;
                font-size: 13px;
            }
        }

        /* ===== NOTEBOOKS (1024px - 1366px) ===== */
        @media (min-width: 769px) and (max-width: 1366px) {
            :root {
                --sidebar-width: 60px;
                --sidebar-expanded-width: 170px;
            }

            .sidebar-logo {
                width: 35px;
                height: 35px;
                min-width: 35px;
                font-size: 16px;
            }

            .sidebar-header {
                height: 50px;
                padding: 8px;
            }

            .menu-item {
                height: 44px;
                padding: 0 12px;
            }

            .menu-item .menu-icon {
                font-size: 18px;
            }

            .menu-item .menu-text {
                font-size: 13px;
            }

            .content-header {
                height: 50px;
                padding: 0 16px;
            }

            .page-title {
                font-size: 14px;
                gap: 8px;
            }

            .page-title i {
                font-size: 16px;
            }

            .page-title span {
                max-width: 450px;
                overflow: hidden;
                text-overflow: ellipsis;
                white-space: nowrap;
            }

            .header-btn {
                width: 32px;
                height: 32px;
            }

            .tabs-container {
                padding: 10px;
            }

            .tab {
                border-radius: 8px;
            }

            .theme-toggle,
            .expand-toggle {
                height: 36px;
            }

            .copyright-info {
                font-size: 9px;
                padding: 6px 4px;
            }

            .license-img {
                height: 13px;
            }

            .sidebar-menu {
                height: calc(100vh - 100px);
            }

            .flyout-menu {
                left: 60px;
                width: 230px;
                min-width: 230px;
            }

            .sidebar.expanded .flyout-menu {
                left: 170px;
            }
        }

        /* ===== TELAS MUITO PEQUENAS (altura) ===== */
        @media (max-height: 700px) {
            .sidebar-header {
                height: 45px;
                min-height: 45px;
            }

            .menu-item {
                height: 38px;
                min-height: 38px;
            }

            .theme-toggle,
            .expand-toggle {
                height: 32px;
                min-height: 32px;
            }

            .content-header {
                height: 45px;
            }

            .copyright-info {
                padding: 3px;
                margin-bottom: 3px;
                font-size: 8px;
            }

            .license-img {
                height: 12px;
            }

            .sidebar-footer {
                padding: 4px;
            }
        }

        /* ===== TELAS EXTREMAMENTE PEQUENAS (altura) ===== */
        @media (max-height: 550px) {
            .sidebar-header {
                height: 40px;
                min-height: 40px;
            }

            .menu-item {
                height: 34px;
                min-height: 34px;
            }

            .menu-item .menu-icon {
                font-size: 16px;
            }

            .theme-toggle,
            .expand-toggle {
                height: 28px;
                min-height: 28px;
            }

            .copyright-info {
                display: none;
            }

            .sidebar-footer {
                padding: 3px;
            }

            .content-header {
                height: 40px;
            }

            .page-title {
                font-size: 12px;
            }
        }

        /* ===== TELAS MUITO LARGAS ===== */
        @media (min-width: 1920px) {
            :root {
                --sidebar-width: 80px;
                --sidebar-expanded-width: 240px;
            }

            .page-title {
                font-size: 20px;
            }

            .menu-item {
                height: 55px;
            }

            .menu-item .menu-icon {
                font-size: 22px;
            }
        }

        .mobile-menu-btn {
            display: none;
            width: 36px;
            height: 36px;
            border: none;
            background: transparent;
            color: var(--text-content, #374151);
            cursor: pointer;
            margin-right: 12px;
            border-radius: 8px;
        }

        .mobile-menu-btn:hover {
            background: rgba(0,0,0,0.05);
        }

        /* Mobile overlay */
        .mobile-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0,0,0,0.5);
            z-index: 999;
        }

        .mobile-overlay.active {
            display: block;
        }

        /* Loading state */
        .tab-loading {
            display: flex;
            align-items: center;
            justify-content: center;
            height: 100%;
            color: #9ca3af;
        }

        .tab-loading i {
            font-size: 32px;
            animation: spin 1s linear infinite;
        }

        @keyframes spin {
            from { transform: rotate(0deg); }
            to { transform: rotate(360deg); }
        }

        /* Inline content styles */
        .inline-content h3 {
            font-size: 20px;
            font-weight: 600;
            margin-bottom: 20px;
            color: var(--text-content, #1f2937);
        }

        .inline-content input[type="text"],
        .inline-content input[type="file"] {
            width: 100%;
            padding: 12px 16px;
            border: 1px solid #e5e7eb;
            border-radius: 8px;
            margin-bottom: 16px;
            font-size: 14px;
        }

        .inline-content .result-box {
            background: #f9fafb;
            padding: 16px;
            border-radius: 8px;
            color: #374151;
            min-height: 60px;
        }