/* === ESTILOS ESPECÍFICOS DO APP (Sobrescrevem ou complementam admin.css) === */

        :root {
            /* Mapeamento de variáveis antigas para as novas do admin.css */
            --bg-1: var(--cor-bg);
            --bg-2: var(--cor-bg-2);
            --bg-3: var(--cor-bg-3);
            --bg-hover: rgba(255, 255, 255, 0.05);

            --texto-1: var(--cor-texto);
            --texto-2: var(--cor-texto-2);
            --texto-3: var(--cor-texto-3);

            --primaria: var(--cor-primaria);
            --primaria-hover: var(--cor-primaria-hover);
            --primaria-bg: var(--cor-primaria-glow);
            --primaria-borda: rgba(139, 92, 246, 0.3);

            --borda: var(--cor-borda);
            --borda-2: var(--cor-borda-hover);
            --erro: var(--cor-erro);
            --sucesso: var(--cor-sucesso);
            --aviso: var(--cor-aviso);
        }

        /* Ajustes para o App rodar em iframe/extensão */
        html,
        body {
            width: 100%;
            height: 100%;
            margin: 0;
            padding: 0;
            overflow: hidden;
            background: var(--bg-1);
            color: var(--texto-1);
            /* App gerencia seu próprio scroll no conteúdo */
        }

        /* === TELAS === */
        .tela {
            display: none;
            height: 100%;
            flex-direction: column;
        }

        .tela.ativa {
            display: flex;
        }

        /* O restante do CSS inline específico do App continua aqui, 
           mas removemos as regras de .login*, .btn*, .form* que agora vêm do admin.css */


        .login-erro {
            margin-top: 12px;
            padding: 10px;
            background: rgba(239, 68, 68, .1);
            border: 1px solid rgba(239, 68, 68, .2);
            border-radius: 8px;
            color: var(--erro);
            font-size: 12px;
            display: none;
        }

        /* === HEADER (biblioteca) === */
        .header {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 14px 20px;
            border-bottom: 1px solid var(--borda);
            background: var(--bg-2);
            flex-shrink: 0;
        }

        .logo {
            display: flex;
            align-items: center;
            gap: 12px;
            font-weight: 700;
            font-size: 16px;
            flex-shrink: 0;
            color: var(--texto-1, #e2e8f0);
        }

        .logo img {
            width: 112px;
        }

        .logo-icon {
            display: none;
            /* Deprecated */
        }

        .logo-icon svg {
            width: 14px;
            height: 14px;
            fill: #fff;
        }




        /* Busca */
        .busca-wrap {
            flex: 1;
            position: relative;
            min-width: 0;
        }

        .busca-icon {
            position: absolute;
            left: 12px;
            top: 50%;
            transform: translateY(-50%);
            color: var(--texto-3);
            display: flex;
        }

        .busca-input {
            width: 100%;
            padding: 9px 14px 9px 36px;
            background: var(--bg-3);
            border: 1px solid var(--borda);
            border-radius: 8px;
            color: var(--texto-1);
            font-size: 13px;
            outline: none;
            transition: border .2s;
        }

        .busca-input:focus {
            border-color: var(--primaria);
        }

        .busca-input::placeholder {
            color: var(--texto-3);
        }

        /* Botões do header */
        .header-actions {
            display: flex;
            gap: 6px;
            flex-shrink: 0;
        }

        .header-btn {
            width: 34px;
            height: 34px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: var(--bg-3);
            border: 1px solid var(--borda);
            border-radius: 8px;
            cursor: pointer;
            color: var(--texto-2);
            transition: all .15s;
        }

        .header-btn:hover {
            background: var(--bg-hover);
            color: var(--texto-1);
        }

        /* === FILTROS === */
        .filtros {
            display: flex;
            gap: 6px;
            padding: 12px 20px;
            border-bottom: 1px solid var(--borda);
            flex-wrap: wrap;
            flex-shrink: 0;
            background: var(--bg-1);
        }

        .filtro-btn {
            padding: 6px 14px;
            background: var(--bg-3);
            border: 1px solid var(--borda);
            border-radius: 6px;
            color: var(--texto-2);
            font-size: 12px;
            font-weight: 600;
            cursor: pointer;
            transition: all .15s;
            white-space: nowrap;
        }

        .filtro-btn:hover {
            border-color: var(--borda-2);
            color: var(--texto-1);
        }

        .filtro-btn.ativo {
            background: var(--primaria-bg);
            border-color: var(--primaria-borda);
            color: var(--primaria);
        }

        .filtro-limpar {
            color: var(--texto-3);
            display: flex;
            align-items: center;
            gap: 4px;
        }

        /* === CORPO === */
        .corpo {
            display: flex;
            flex: 1;
            overflow: hidden;
        }

        .tags-sidebar {
            width: 180px;
            border-right: 1px solid var(--borda);
            padding: 16px;
            overflow-y: auto;
            flex-shrink: 0;
            background: var(--bg-1);
        }

        .tags-titulo {
            font-size: 11px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 1px;
            color: var(--texto-3);
            margin-bottom: 4px;
        }

        .tags-subtitulo {
            font-size: 11px;
            color: var(--texto-3);
            margin-bottom: 12px;
        }

        .tag-btn {
            display: block;
            width: 100%;
            padding: 6px 10px;
            background: none;
            border: none;
            color: var(--texto-2);
            font-size: 12px;
            text-align: left;
            cursor: pointer;
            border-radius: 5px;
            margin-bottom: 2px;
            transition: all .15s;
        }

        .tag-btn:hover {
            background: var(--bg-hover);
            color: var(--texto-1);
        }

        .tag-btn.ativo {
            color: var(--primaria);
            background: var(--primaria-bg);
        }

        /* Grid */
        .grid-area {
            flex: 1;
            overflow-y: auto;
            padding: 20px;
        }

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

        /* Card */
        .card {
            position: relative;
            background: var(--card-bg);
            border: 1px solid var(--borda);
            border-radius: 12px;
            overflow: hidden;
            transition: all .2s;
            cursor: pointer;
        }

        .card:hover {
            border-color: var(--borda-2);
            transform: translateY(-2px);
            box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
        }

        .card-img {
            width: 100%;
            aspect-ratio: 16/10;
            object-fit: cover;
            display: block;
            background: var(--bg-3);
        }

        .card-placeholder {
            width: 100%;
            aspect-ratio: 16/10;
            display: flex;
            align-items: center;
            justify-content: center;
            background: var(--bg-3);
            color: var(--texto-3);
        }

        .card-body {
            padding: 12px 14px;
        }

        .card-title {
            font-size: 14px;
            font-weight: 700;
            margin-bottom: 4px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis
        }

        .card-date {
            font-size: 11px;
            color: var(--texto-3);
            margin-bottom: 6px;
        }

        .card-fav {
            position: absolute;
            top: 8px;
            right: 8px;
            width: 32px;
            height: 32px;
            border-radius: 50%;
            background: rgba(0, 0, 0, 0.6);
            backdrop-filter: blur(4px);
            border: 1px solid rgba(255, 255, 255, 0.1);
            color: rgba(255, 255, 255, 0.7);
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            z-index: 2;
            transition: all 0.2s ease;
        }

        .card-fav:hover {
            background: rgba(0, 0, 0, 0.8);
            color: #fff;
            transform: scale(1.1);
        }

        .card-fav.favorito-ativo {
            background: rgba(239, 68, 68, 0.2);
            color: #ef4444;
            border-color: rgba(239, 68, 68, 0.4);
        }

        .card-fav.favorito-ativo svg {
            fill: currentColor;
        }

        .card-badge {
            display: inline-block;
            padding: 2px 8px;
            background: var(--badge-bg);
            color: var(--badge-texto);
            font-size: 10px;
            font-weight: 700;
            border-radius: 4px;
            text-transform: uppercase
        }

        .card-actions {
            display: flex;
            gap: 6px;
            padding: 0 14px 12px
        }

        .card-action-btn {
            flex: 1;
            padding: 8px;
            background: var(--bg-3);
            border: 1px solid var(--borda);
            border-radius: 8px;
            color: var(--texto-2);
            font-size: 12px;
            font-weight: 600;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 5px;
            transition: all .15s
        }

        .card-action-btn:hover {
            background: var(--bg-hover);
            color: var(--texto-1)
        }

        .card-action-btn.primary {
            background: var(--primaria);
            border-color: var(--primaria);
            color: #fff
        }

        .card-action-btn.primary:hover {
            background: var(--primaria-hover)
        }

        /* Vazio / Loading */
        .estado-vazio {
            grid-column: 1/-1;
            text-align: center;
            padding: 60px 20px;
            color: var(--texto-3)
        }

        .estado-vazio svg {
            opacity: .3;
            margin-bottom: 12px
        }

        .spinner {
            width: 32px;
            height: 32px;
            border: 3px solid var(--borda);
            border-top-color: var(--primaria);
            border-radius: 50%;
            animation: spin .8s linear infinite;
            margin: 40px auto
        }

        @keyframes spin {
            to {
                transform: rotate(360deg)
            }
        }

        /* Paginação */
        .paginacao {
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 10px;
            padding: 16px 0
        }

        .pag-btn {
            padding: 6px 14px;
            background: var(--bg-3);
            border: 1px solid var(--borda);
            border-radius: 6px;
            color: var(--texto-2);
            font-size: 12px;
            font-weight: 600;
            cursor: pointer;
            transition: all .15s
        }

        .pag-btn:hover:not(:disabled) {
            border-color: var(--primaria);
            color: var(--primaria)
        }

        .pag-btn:disabled {
            opacity: .35;
            cursor: not-allowed
        }

        .pag-info {
            font-size: 12px;
            color: var(--texto-3);
            font-weight: 600;
            user-select: none
        }

        /* === PLANOS MODAL === */
        .plano-opcao {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 14px;
            border: 1px solid rgba(255, 255, 255, 0.08);
            border-radius: 10px;
            background: var(--bg-3, #252540);
            cursor: pointer;
            transition: all .15s;
            font-family: inherit;
            color: var(--texto-1, #e2e8f0);
            width: 100%;
        }

        .plano-opcao:hover {
            border-color: #7c3aed;
            background: rgba(124, 58, 237, 0.08);
        }

        .plano-opcao.popular {
            border-color: rgba(167, 139, 250, 0.4);
        }

        /* === MODAL CÓDIGO === */
        .modal-overlay {
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, .6);
            display: none;
            align-items: center;
            justify-content: center;
            z-index: 100;
            padding: 20px
        }

        .modal-overlay.ativo {
            display: flex;
            opacity: 1;
            visibility: visible;
        }

        .modal-overlay.ativo .modal {
            transform: translateY(0);
        }

        .modal {
            background: var(--bg-2);
            border: 1px solid var(--borda);
            border-radius: 14px;
            width: 100%;
            max-width: 640px;
            max-height: 85vh;
            display: flex;
            flex-direction: column
        }

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

        .modal-titulo {
            font-size: 16px;
            font-weight: 700
        }

        .modal-fechar {
            width: 30px;
            height: 30px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: var(--bg-3);
            border: 1px solid var(--borda);
            border-radius: 6px;
            cursor: pointer;
            color: var(--texto-2);
            transition: all .15s
        }

        .modal-fechar:hover {
            background: var(--bg-hover)
        }

        .modal-body {
            flex: 1;
            overflow-y: auto;
            padding: 20px
        }

        .modal-code {
            background: var(--bg-1);
            border: 1px solid var(--borda);
            border-radius: 10px;
            padding: 16px;
            font-family: 'Fira Code', monospace;
            font-size: 12px;
            color: var(--texto-2);
            white-space: pre-wrap;
            word-break: break-all;
            max-height: 300px;
            overflow-y: auto
        }

        .modal-footer {
            padding: 12px 20px;
            border-top: 1px solid var(--borda);
            display: flex;
            gap: 8px;
            justify-content: flex-end
        }

        .modal-btn {
            padding: 10px 20px;
            border-radius: 8px;
            font-size: 13px;
            font-weight: 700;
            cursor: pointer;
            transition: all .15s;
            border: none
        }

        .modal-btn-secondary {
            background: var(--bg-3);
            color: var(--texto-2)
        }

        .modal-btn-primary {
            background: var(--primaria);
            color: #fff
        }

        .modal-btn-primary:hover {
            background: var(--primaria-hover)
        }

        /* === PERFIL === */
        .perfil {
            overflow-y: auto
        }

        .perfil-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 14px 20px;
            border-bottom: 1px solid var(--borda);
            background: var(--bg-2)
        }

        .perfil-header-btn {
            width: 34px;
            height: 34px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: var(--bg-3);
            border: 1px solid var(--borda);
            border-radius: 8px;
            cursor: pointer;
            color: var(--texto-2);
            transition: all .15s
        }

        .perfil-header-btn:hover {
            background: var(--bg-hover)
        }

        .perfil-body {
            padding: 32px 20px;
            text-align: center
        }

        .perfil-avatar {
            width: 72px;
            height: 72px;
            background: var(--primaria);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0 auto 12px;
            font-size: 28px;
            font-weight: 800;
            color: #fff
        }

        .perfil-nome {
            font-size: 18px;
            font-weight: 700;
            margin-bottom: 4px
        }

        .perfil-email {
            font-size: 13px;
            color: var(--texto-3);
            margin-bottom: 24px
        }

        .perfil-section {
            text-align: left;
            margin-bottom: 20px
        }

        .perfil-section-titulo {
            font-size: 10px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 1px;
            color: var(--texto-3);
            margin-bottom: 8px;
            padding: 0 4px
        }

        .perfil-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 10px 12px;
            border-bottom: 1px solid var(--borda);
            font-size: 13px
        }

        .perfil-item-label {
            color: var(--texto-2)
        }

        .perfil-item-value {
            font-weight: 600;
            color: var(--texto-1)
        }

        .perfil-toggle {
            position: relative;
            width: 44px;
            height: 24px;
            background: var(--bg-4);
            border-radius: 12px;
            cursor: pointer;
            transition: background .2s
        }

        .perfil-toggle.ativo {
            background: var(--primaria)
        }

        .perfil-toggle::after {
            content: '';
            position: absolute;
            top: 2px;
            left: 2px;
            width: 20px;
            height: 20px;
            background: #fff;
            border-radius: 50%;
            transition: transform .2s
        }

        .perfil-toggle.ativo::after {
            transform: translateX(20px)
        }

        .perfil-textarea {
            width: 100%;
            padding: 10px 12px;
            background: var(--input-bg);
            border: 1px solid var(--borda);
            border-radius: 8px;
            color: var(--texto-1);
            font-size: 12px;
            font-family: 'Fira Code', monospace;
            outline: none;
            resize: vertical;
            min-height: 80px;
            transition: border .2s
        }

        .perfil-textarea:focus {
            border-color: var(--primaria)
        }

        .perfil-hint {
            font-size: 11px;
            color: var(--texto-3);
            margin-top: 4px;
            padding: 0 4px
        }

        /* === TOAST === */
        .toast {
            position: fixed;
            bottom: 24px;
            left: 50%;
            transform: translateX(-50%) translateY(100px);
            background: var(--bg-2);
            border: 1px solid var(--primaria-borda);
            border-radius: 12px;
            padding: 14px 24px;
            color: var(--texto-1);
            font-size: 13px;
            font-weight: 500;
            z-index: 200;
            display: flex;
            align-items: center;
            gap: 10px;
            box-shadow: 0 10px 40px rgba(0, 0, 0, .4);
            opacity: 0;
            transition: all .35s cubic-bezier(.32, .72, 0, 1);
            max-width: 420px;
            text-align: center;
            line-height: 1.5
        }

        .toast.visivel {
            transform: translateX(-50%) translateY(0);
            opacity: 1
        }

        /* Spinner de loading para botões */
        .spinner-sm {
            display: inline-block;
            width: 12px;
            height: 12px;
            border: 2px solid currentColor;
            border-right-color: transparent;
            border-radius: 50%;
            animation: spin .6s linear infinite;
            vertical-align: middle;
        }

        @keyframes spin {
            to {
                transform: rotate(360deg)
            }
        }

        .toast-icon {
            flex-shrink: 0;
            width: 32px;
            height: 32px;
            background: var(--sucesso);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center
        }

        /* === TELA COMO USAR === */
        .como-usar {
            overflow-y: auto
        }

        .como-usar-body {
            padding: 40px 32px;
            max-width: 560px;
            margin: 0 auto
        }

        .como-usar-icon {
            width: 64px;
            height: 64px;
            background: var(--primaria-bg);
            border: 1px solid var(--primaria-borda);
            border-radius: 16px;
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0 auto 20px;
            color: var(--primaria)
        }

        .como-usar-titulo {
            text-align: center;
            font-size: 22px;
            font-weight: 800;
            margin-bottom: 6px
        }

        .como-usar-sub {
            text-align: center;
            font-size: 13px;
            color: var(--texto-3);
            margin-bottom: 32px
        }

        .passo {
            display: flex;
            gap: 16px;
            padding: 16px 0;
            border-bottom: 1px solid var(--borda)
        }

        .passo:last-child {
            border-bottom: none
        }

        .passo-num {
            width: 36px;
            height: 36px;
            background: var(--primaria);
            border-radius: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 800;
            font-size: 15px;
            color: #fff;
            flex-shrink: 0
        }

        .passo-info {
            flex: 1
        }

        .passo-titulo {
            font-size: 14px;
            font-weight: 700;
            margin-bottom: 4px
        }

        .passo-desc {
            font-size: 12px;
            color: var(--texto-2);
            line-height: 1.5
        }

        .passo-destaque {
            display: inline-block;
            margin-top: 8px;
            padding: 8px 14px;
            background: var(--bg-3);
            border: 1px solid var(--borda);
            border-radius: 8px;
            font-family: 'Fira Code', monospace;
            font-size: 12px;
            color: var(--primaria);
            font-weight: 600
        }