
        /* ===== ESTILOS GLOBAIS ===== */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
            background: #f0f2f5;
            min-height: 100vh;
            padding: 20px;
        }

        .container {
            max-width: 1200px;
            margin: 0 auto;
        }

        /* ===== HEADER ===== */
        .header {
            background: white;
            border-radius: 12px;
            padding: 20px 30px;
            margin-bottom: 30px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.08);
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
            gap: 15px;
        }

        .header h1 {
            font-size: 24px;
            color: #1a1a1a;
        }

        .header-actions {
            display: flex;
            gap: 10px;
            align-items: center;
            flex-wrap: wrap;
        }

        .user-email {
            color: #7f8c8d;
            font-size: 14px;
        }

        /* ===== BOTÕES ===== */
        .btn {
            padding: 8px 20px;
            border: none;
            border-radius: 6px;
            cursor: pointer;
            font-size: 14px;
            font-weight: 500;
            transition: all 0.2s;
        }

        .btn-danger {
            background: #e74c3c;
            color: white;
        }
        .btn-danger:hover {
            background: #c0392b;
        }

        .btn-success {
            background: #2ecc71;
            color: white;
        }
        .btn-success:hover {
            background: #27ae60;
        }

        .btn-secondary {
            background: #95a5a6;
            color: white;
        }
        .btn-secondary:hover {
            background: #7f8c8d;
        }

        .btn-secondary2 {
            background: #f0ece6;
            color: #2d2a24;
            border: 1px solid #e5ddd4;
            padding: 0.5rem 1.2rem;
            border-radius: 30px;
            cursor: pointer;
            transition: all 0.2s;
            font-size: 0.85rem;
        }
        .btn-secondary2:hover {
            background: #e8e1d8;
        }

        .btn-gratis {
            background: #27ae60;
            color: white;
            padding: 10px 30px;
            font-size: 16px;
            border: none;
            border-radius: 6px;
            cursor: pointer;
            transition: background 0.2s;
            font-weight: 600;
        }
        .btn-gratis:hover {
            background: #1e8449;
        }

        .btn-tab {
            background: transparent;
            border: 2px solid #dce1e8;
            padding: 8px 20px;
            border-radius: 6px;
            cursor: pointer;
            font-weight: 500;
            transition: all 0.2s;
        }
        .btn-tab:hover {
            background: #f0f2f5;
        }
        .btn-tab.active {
            background: #3498db;
            color: white;
            border-color: #3498db;
        }

        .btn-excluir-condicional {
            background: transparent;
            color: #e74c3c;
            border: 1px solid #e74c3c;
            padding: 4px 12px;
            font-size: 12px;
            cursor: pointer;
            border-radius: 4px;
            transition: all 0.2s;
        }
        .btn-excluir-condicional:hover {
            background: #e74c3c;
            color: white;
        }

        /* ===== CARDS ===== */
        .licencas-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
            gap: 40px;
            margin-top: 20px;
        }

        .licenca-card {
            background: white;
            border-radius: 12px;
            padding: 24px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.08);
            transition: transform 0.2s, box-shadow 0.2s;
            cursor: pointer;
            border: 2px solid transparent;
            
        }
        .licenca-card:hover {
            transform: translateY(-4px);
            box-shadow: 0 8px 25px rgba(0,0,0,0.12);
            border-color: #3498db;
        }

        .app-card {
            background: white;
            border-radius: 12px;
            padding: 24px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.08);
            transition: transform 0.2s, box-shadow 0.2s;
            cursor: pointer;
            border: 2px solid transparent;
        }
        .app-card:hover {
            transform: translateY(-4px);
            box-shadow: 0 8px 25px rgba(0,0,0,0.12);
            border-color: #2ecc71;
        }

        .app-card .app-icon {
            font-size: 48px;
            margin-bottom: 20px;
            display: block;
            gap: 15px;
        }
        .app-card h3 {
            font-size: 20px;
            color: #2c3e50;
            margin-bottom: 15px;
        }
        .app-card .app-dir {
            color: #7f8c8d;
            font-size: 14px;
            margin-bottom: 8px;
        }
        .app-card .app-expiry {
            font-size: 14px;
            margin-top: 12px;
            padding-top: 12px;
            border-top: 1px solid #e8ecf1;
        }
        .app-card .app-expiry.danger {
            color: #e74c3c;
            font-weight: 700;
        }
        .app-card .app-expiry.warning {
            color: #f39c12;
            font-weight: 600;
        }
        .app-card .app-expiry.success {
            color: #27ae60;
        }
        .app-card .btn-acessar {
            margin-top: 12px;
            display: inline-block;
            background: #2ecc71;
            color: white;
            padding: 8px 24px;
            border-radius: 6px;
            text-decoration: none;
            font-weight: 500;
            transition: background 0.2s;
        }
        .app-card .btn-acessar:hover {
            background: #27ae60;
        }

        /* ===== BADGES ===== */
        .badge {
            display: inline-block;
            padding: 4px 12px;
            border-radius: 20px;
            font-size: 12px;
            font-weight: 600;
            margin-bottom: 12px;
        }
        .badge-principal {
            background: #3498db;
            color: white;
        }
        .badge-gratis {
            background: #27ae60;
            color: white;
        }
        .badge-app {
            background: #2c3e50;
            color: white;
        }

        .badge-group {
            display: flex;
            align-items: center;
            gap: 8px;
            flex-wrap: wrap;
            margin-bottom: 12px;
            min-height: 28px;
        }
        .badge-group .badge {
            display: inline-flex;
            align-items: center;
            padding: 4px 14px;
            border-radius: 20px;
            font-size: 12px;
            font-weight: 600;
            line-height: 1.4;
            white-space: nowrap;
            margin-bottom: 0;
        }

        /* ===== LICENÇA CARD DETALHES ===== */
        .licenca-card h3 {
            font-size: 18px;
            color: #2c3e50;
            margin-bottom: 8px;
        }
        .licenca-card .periodo {
            color: #7f8c8d;
            font-size: 14px;
            margin-bottom: 8px;
        }
        .licenca-card .valor {
            font-size: 24px;
            font-weight: 700;
            color: #27ae60;
            margin: 12px 0;
        }
        .licenca-card .valor.gratis {
            color: red;
        }
        .licenca-card .condicoes {
            margin-top: 12px;
            padding-top: 12px;
            border-top: 1px solid #e8ecf1;
        }
        .licenca-card .condicoes small {
            display: block;
            color: #7f8c8d;
            font-size: 13px;
            margin: 4px 0;
        }
        .licenca-card .status {
            margin-top: 12px;
            padding-top: 12px;
            border-top: 1px solid #e8ecf1;
            font-size: 13px;
        }
        .status-ativa {
            color: #27ae60;
        }

        /* ===== MODAL ===== */
        .modal-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0,0,0,0.5);
            z-index: 1000;
            justify-content: center;
            align-items: center;
            padding: 20px;
        }
        .modal-overlay.active {
            display: flex;
        }

        .modal {
            background: white;
            border-radius: 16px;
            max-width: 650px;
            width: 100%;
            max-height: 90vh;
            overflow-y: auto;
            padding: 30px;
            animation: modalIn 0.3s ease;
        }

        @keyframes modalIn {
            from { transform: translateY(-30px); opacity: 0; }
            to { transform: translateY(0); opacity: 1; }
        }

        .modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
            padding-bottom: 15px;
            border-bottom: 1px solid #e8ecf1;
        }
        .modal-header h2 {
            font-size: 22px;
            color: #2c3e50;
        }
        .modal-close {
            background: none;
            border: none;
            font-size: 28px;
            cursor: pointer;
            color: #95a5a6;
            transition: color 0.2s;
        }
        .modal-close:hover {
            color: #e74c3c;
        }

        .modal-body {
            padding: 10px 0;
        }
        .modal-footer {
            margin-top: 20px;
            padding-top: 20px;
            border-top: 1px solid #e8ecf1;
            display: flex;
            justify-content: flex-end;
            gap: 10px;
            flex-wrap: wrap;
        }

        /* ===== CONDICIONAIS ===== */
        .condicional-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 14px 18px;
            background: #f8f9fa;
            border-radius: 10px;
            margin: 8px 0;
            transition: all 0.3s ease;
            cursor: pointer;
            border: 2px solid transparent;
        }
        .condicional-item:hover {
            background: #e8ecf1;
        }
        .condicional-item.selecionado {
            background: #e8f8f0;
            border-color: #27ae60;
            box-shadow: 0 2px 12px rgba(39, 174, 96, 0.15);
        }
        .condicional-item .info {
            flex: 1;
            margin-right: 15px;
        }
        .condicional-item .info strong {
            display: block;
            color: #2c3e50;
            font-size: 15px;
        }
        .condicional-item .info small {
            color: #7f8c8d;
            font-size: 13px;
        }
        .condicional-item .valor {
            font-weight: 700;
            color: #27ae60;
            margin: 0 15px;
            font-size: 16px;
            min-width: 70px;
            text-align: right;
        }
        .condicional-item .actions {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .btn-radio {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 28px;
            height: 28px;
            border-radius: 50%;
            border: 2px solid #dce1e8;
            background: white;
            cursor: pointer;
            transition: all 0.3s ease;
            flex-shrink: 0;
        }
        .btn-radio:hover {
            border-color: #27ae60;
            background: #e8f8f0;
            transform: scale(1.1);
        }
        .btn-radio.selecionado {
            border-color: #27ae60;
            background: #27ae60;
        }
        .btn-radio.selecionado:hover {
            background: #1e8449;
            border-color: #1e8449;
        }
        .btn-radio .checkmark {
            display: none;
            color: white;
            font-size: 16px;
            font-weight: 700;
            line-height: 1;
        }
        .btn-radio.selecionado .checkmark {
            display: block;
        }

        .sem-condicionais {
            color: #95a5a6;
            font-size: 14px;
            text-align: center;
            padding: 20px;
            background: #f8f9fa;
            border-radius: 8px;
        }

        /* ===== DETALHES COMPRA ===== */
        .detalhes-compra {
            background: #f8f9fa;
            padding: 12px 16px;
            border-radius: 8px;
            margin: 15px 0;
        }
        .detalhes-compra .linha {
            display: flex;
            justify-content: space-between;
            padding: 4px 0;
            font-size: 14px;
        }
        .detalhes-compra .linha.total {
            font-weight: 700;
            border-top: 2px solid #dee2e6;
            padding-top: 8px;
            margin-top: 4px;
            font-size: 16px;
        }
        .detalhes-compra .linha .valor-item {
            color: #27ae60;
        }
        .detalhes-compra .linha .valor-item.principal {
            color: #3498db;
        }

        /* ===== INFO GRÁTIS ===== */
        .info-gratis {
            background: #e8f8f0;
            padding: 15px 20px;
            border-radius: 8px;
            margin: 15px 0;
            text-align: center;
            border: 2px solid #27ae60;
        }
        .info-gratis .icone {
            font-size: 48px;
            display: block;
            margin-bottom: 10px;
        }
        .info-gratis h3 {
            color: #27ae60;
            margin-bottom: 5px;
        }
        .info-gratis p {
            color: #555;
            font-size: 14px;
        }

        .info-extra {
            background: #e8f0fe;
            padding: 10px 15px;
            border-radius: 6px;
            margin: 10px 0;
            font-size: 13px;
            color: #2980b9;
            border-left: 3px solid #3498db;
        }

        /* ===== PAGAMENTO ===== */
        .pagamento-section.hidden {
            display: none;
        }
        .form-group {
            margin-bottom: 15px;
        }
        .form-group label {
            display: block;
            font-weight: 500;
            color: #2c3e50;
            margin-bottom: 5px;
            font-size: 14px;
        }
        .form-group input,
        .form-group select {
            width: 100%;
            padding: 10px 14px;
            border: 1px solid #dce1e8;
            border-radius: 6px;
            font-size: 14px;
            transition: border-color 0.2s;
        }
        .form-group input:focus,
        .form-group select:focus {
            outline: none;
            border-color: #3498db;
        }
        .form-row {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 15px;
        }

        .licenca-principal-info {
            background: #f8f9fa;
            padding: 15px;
            border-radius: 8px;
            margin-bottom: 15px;
        }

        /* ===== MENSAGENS ===== */
        .mensagem {
            padding: 12px 20px;
            border-radius: 8px;
            margin: 10px 0;
            display: none;
        }
        .mensagem.erro {
            display: block;
            background: #fde8e8;
            color: #c0392b;
            border: 1px solid #f5c6c6;
        }
        .mensagem.sucesso {
            display: block;
            background: #e8f8f0;
            color: #27ae60;
            border: 1px solid #b8e6d0;
        }
        .mensagem.info {
            display: block;
            background: #e8f0fe;
            color: #2980b9;
            border: 1px solid #b8d4f0;
        }

        .toast {
            position: fixed;
            bottom: 20px;
            right: 20px;
            background: #2c3e50;
            color: white;
            padding: 15px 25px;
            border-radius: 8px;
            box-shadow: 0 4px 15px rgba(0,0,0,0.2);
            z-index: 2000;
            animation: slideIn 0.3s ease;
            max-width: 400px;
        }
        .toast.success { background: #27ae60; }
        .toast.error { background: #e74c3c; }
        .toast.info { background: #3498db; }

        @keyframes slideIn {
            from { transform: translateX(100%); opacity: 0; }
            to { transform: translateX(0); opacity: 1; }
        }

        /* ===== LOADING ===== */
        .loading {
            text-align: center;
            padding: 40px;
            color: #7f8c8d;
        }
        .loading .spinner {
            display: inline-block;
            width: 40px;
            height: 40px;
            border: 4px solid #e8ecf1;
            border-top-color: #3498db;
            border-radius: 50%;
            animation: spin 0.8s linear infinite;
        }
        @keyframes spin {
            to { transform: rotate(360deg); }
        }

        /* ===== EMPTY STATE ===== */
        .empty-state {
            text-align: center;
            padding: 60px 20px;
            background: white;
            border-radius: 12px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.08);
            grid-column: 1/-1;
        }
        .empty-state .icone {
            font-size: 64px;
            display: block;
            margin-bottom: 20px;
        }
        .empty-state h3 {
            color: #2c3e50;
            margin-bottom: 10px;
        }
        .empty-state p {
            color: #7f8c8d;
        }

        /* ===== TABS ===== */
        .secao-tabs {
            display: flex;
            gap: 10px;
            margin-bottom: 20px;
            flex-wrap: wrap;
        }

        /* ===== RESPONSIVO ===== */
        @media (max-width: 768px) {
            .header {
                flex-direction: column;
                text-align: center;
            }
            .licencas-grid {
                grid-template-columns: 1fr;
            }
            .modal {
                padding: 20px;
            }
            .form-row {
                grid-template-columns: 1fr;
            }
            .condicional-item {
                flex-wrap: wrap;
                gap: 10px;
            }
            .condicional-item .valor {
                margin: 0;
            }
            .condicional-item .actions {
                width: 100%;
                justify-content: flex-end;
            }
        }

/* ============================================
   SPINNER CENTRALIZADO - Z-INDEX MÁXIMO
============================================ */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999; /* Muito alto para ficar acima de tudo */
    animation: fadeInOverlay 0.3s ease;
}

.spinner-container {
    background: rgba(255, 255, 255, 0.95);
    padding: 40px 50px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
    animation: scaleIn 0.3s ease;
    max-width: 90%;
    position: relative;
    z-index: 1000000;
}

@keyframes fadeInOverlay {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.spinner-container {
    background: rgba(255, 255, 255, 0.95);
    padding: 40px 50px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
    animation: scaleIn 0.3s ease;
    max-width: 90%;
}

@keyframes scaleIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.spinner-central {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    border: 5px solid #e8ecf1;
    border-top: 5px solid #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.spinner-texto {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 8px 0;
}

.spinner-subtexto {
    font-size: 14px;
    color: #95a5a6;
    margin: 0;
}

/* Variação para compra gratuita */
.spinner-container.gratis .spinner-central {
    border-top-color: #27ae60;
}

/* Responsivo */
@media (max-width: 480px) {
    .spinner-container {
        padding: 30px 25px;
    }
    .spinner-central {
        width: 45px;
        height: 45px;
        border-width: 4px;
    }
    .spinner-texto {
        font-size: 16px;
    }
    .spinner-subtexto {
        font-size: 13px;
    }
}


/* ============================================
   FILTROS POR APP
   ============================================ */
.filtros-container {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px 20px;
    background: #f8f9fa;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 1px solid #e8ecf1;
}

.filtros-label {
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
    margin-right: 8px;
}

.filtros-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filtro-tag {
    padding: 6px 16px;
    border-radius: 20px;
    border: 2px solid #dce1e8;
    background: white;
    color: #555;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.filtro-tag:hover {
    border-color: #667eea;
    color: #667eea;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
}

.filtro-tag.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.filtro-tag .filtro-check {
    font-size: 12px;
    font-weight: 700;
}

.resultados-contador {
    font-size: 14px;
    color: #7f8c8d;
    margin-bottom: 16px;
    padding: 8px 0;
    border-bottom: 1px dashed #e8ecf1;
}

/* Responsivo */
@media (max-width: 600px) {
    .filtros-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 12px 16px;
    }
    
    .filtros-tags {
        width: 100%;
    }
    
    .filtro-tag {
        font-size: 12px;
        padding: 5px 12px;
    }
}


.info-extra {
    padding: 15px 20px;
    background: #e8f8f0;
    border-left: 4px solid #27ae60;
    border-radius: 8px;
    color: #27ae60;
}

.info-extra h3 {
    margin: 5px 0;
}

.btn-success {
    background: #27ae60;
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-success:hover {
    background: #219a52;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
}
/*
.licenca-card.gratis-card {
    border: 2px solid #27ae60;
    background: linear-gradient(135deg, #f0fff4 0%, #ffffff 100%);
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.15);
}*/

.licenca-card.gratis-card {
    border: 3px solid #27ae60;
    background: linear-gradient(135deg, #f0fff4 0%, #ffffff 100%);
    /*
    box-shadow: 
        0 0 0 8px rgba(39, 174, 96, 0.08),
        0 0 0 16px rgba(39, 174, 96, 0.05),
        0 4px 15px rgba(39, 174, 96, 0.15);*/
    /* Ou se preferir uma borda mais destacada: */
    
    box-shadow: 0 0 0 10px rgba(39, 174, 96, 0.12), 0 4px 20px rgba(39, 174, 96, 0.6); 
}

.licenca-card.gratis-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(7, 23, 14, 0.8);
}