/**
 * Estilos públicos para ESPM Grupos Acadêmicos
 */

/* Ocultar header do Elementor e título da página na dashboard */
body.page .espm-ga-dashboard ~ header[data-elementor-type="header"],
body.page header[data-elementor-type="header"]:has(~ .espm-ga-dashboard),
body.page .page-header:has(+ .espm-ga-dashboard),
body.page .espm-ga-dashboard + .page-header {
    display: none !important;
}

/* Alternativa: ocultar na página da dashboard especificamente */
.page-template-default .elementor-location-header {
    display: none !important;
}

.page-template-default .page-header {
    display: none !important;
}

/* Ocultar barra de administração do WordPress na dashboard */
body.page #wpadminbar {
    display: none !important;
}

/* Ajustar o topo da página quando a admin bar estiver oculta */
body.page.admin-bar {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

body.page.admin-bar html {
    margin-top: 0 !important;
}

/* Reset para garantir que nada vaze */
.espm-ga-dashboard *,
.espm-ga-dashboard *::before,
.espm-ga-dashboard *::after {
    box-sizing: border-box;
}

/* Prevenir vazamento de texto em elementos específicos */
.espm-ga-dashboard .espm-ga-btn,
.espm-ga-dashboard .espm-role-badge {
    word-wrap: break-word;
    word-break: break-word;
}

/* Dashboard Container */
.espm-ga-dashboard {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

/* Paleta de cores ESPM (escopo local da dashboard) */
.espm-ga-dashboard {
    --espm-primary: #A60F36;        /* Vermelho ESPM */
    --espm-primary-600: #8C0D2E;    /* Mais escuro */
    --espm-primary-700: #7A0B28;    /* Acento forte */
    --espm-primary-100: #F8E6EB;    /* Muito claro */
    --espm-primary-200: #F2CCD6;    /* Claro */
    --espm-neutral-50: #fafafa;
    --espm-neutral-100: #f5f5f5;
    --espm-neutral-200: #eeeeee;
    --espm-neutral-800: #2c3e50;
}

/* Header da Dashboard */
.espm-ga-dashboard-header {
    margin-bottom: 40px;
    padding: 30px;
    background: linear-gradient(135deg, var(--espm-primary) 0%, var(--espm-primary-700) 100%);
    color: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.espm-ga-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.espm-ga-header-info {
    flex: 1;
    min-width: 300px;
    text-align: left;
}

.espm-ga-dashboard-header h2 {
    margin: 0 0 10px 0;
    font-size: 2.5em;
    font-weight: 700;
}

.espm-ga-dashboard-header p {
    margin: 0;
    font-size: 1.2em;
    opacity: 0.9;
}

.espm-ga-header-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.espm-ga-header-actions .espm-ga-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    font-size: 14px;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    white-space: nowrap;
}

.espm-ga-header-actions .espm-ga-btn-secondary {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.espm-ga-header-actions .espm-ga-btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

.espm-ga-header-actions .espm-ga-btn-danger {
    background-color: rgba(231, 76, 60, 0.8);
    color: white;
    border: 1px solid rgba(231, 76, 60, 0.9);
}

.espm-ga-header-actions .espm-ga-btn-danger:hover {
    background-color: rgba(231, 76, 60, 1);
    border-color: #e74c3c;
}

.espm-icon-user,
.espm-icon-logout,
.espm-icon-document {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* Botão de informações (conteúdos) */
.espm-ga-header-actions .espm-ga-btn-info {
    background: linear-gradient(135deg, var(--espm-primary) 0%, var(--espm-primary-600) 100%);
    color: #fff;
    border: 1px solid var(--espm-primary-600);
}

.espm-ga-header-actions .espm-ga-btn-info:hover {
    background: linear-gradient(135deg, var(--espm-primary-600) 0%, var(--espm-primary-700) 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(166, 15, 54, 0.3);
}

/* Botão de conteúdos nos cards dos grupos */
.espm-ga-grupo-actions .espm-ga-btn-info {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    color: white;
    border: 1px solid #17a2b8;
    font-size: 14px;
    padding: 8px 16px;
}

.espm-ga-grupo-actions .espm-ga-btn-info:hover {
    background: linear-gradient(135deg, #138496 0%, #117a8b 100%);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(23, 162, 184, 0.3);
}

/* Grid de Grupos */
.espm-ga-grupos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
    width: 100%;
    box-sizing: border-box;
}

/* Card de Grupo */
.espm-ga-grupo-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
    border: 1px solid #e1e5e9;
    transition: all 0.3s ease;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.espm-ga-grupo-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.espm-ga-grupo-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.espm-ga-grupo-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.4em;
    font-weight: 600;
}

.espm-ga-grupo-role {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.espm-ga-grupo-role.representante {
    background: #e74c3c;
    color: white;
}

.espm-ga-grupo-role.membro {
    background: #3498db;
    color: white;
}

.espm-ga-grupo-role.admin {
    background: #f39c12;
    color: white;
}

/* Conteúdo do Grupo */
.espm-ga-grupo-content p {
    color: #7f8c8d;
    line-height: 1.6;
    margin-bottom: 20px;
}

/* Estatísticas do Grupo */
.espm-ga-grupo-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
}

.espm-ga-stat {
    text-align: center;
    flex: 1;
}

.espm-ga-stat-number {
    display: block;
    font-size: 2em;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1;
}

.espm-ga-stat-label {
    font-size: 0.9em;
    color: #7f8c8d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Ações do Grupo */
.espm-ga-grupo-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: stretch;
    margin-top: 15px;
    justify-content: flex-start;
}

/* Botões */
.espm-ga-btn {
    display: inline-flex;
    padding: 12px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 0.9em;
    flex: 0 1 auto;
    min-width: 140px;
    max-width: 200px;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.3;
    box-sizing: border-box;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    text-overflow: ellipsis;
    hyphens: auto;
    word-break: break-word;
}

.espm-ga-btn-primary {
    background: var(--espm-primary);
    color: #fff;
    min-width: 160px;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.espm-ga-btn-primary:hover {
    background: var(--espm-primary-600);
    transform: translateY(-2px);
}

.espm-ga-btn-secondary {
    background: #ecf0f1;
    color: #2c3e50;
    min-width: 150px;
    max-width: 170px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.espm-ga-btn-secondary:hover {
    background: #bdc3c7;
    transform: translateY(-2px);
}

.espm-ga-btn-tertiary {
    background: var(--espm-primary-600);
    color: #fff;
    min-width: 160px;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.espm-ga-btn-tertiary:hover {
    background: var(--espm-primary-700);
    transform: translateY(-2px);
}

.espm-ga-btn-content {
    background: var(--espm-primary);
    color: #fff;
    min-width: 150px;
    max-width: 170px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.espm-ga-btn-content:hover {
    background: var(--espm-primary-600);
    transform: translateY(-2px);
}

/* Sem Grupos */
.espm-ga-no-grupos {
    text-align: center;
    padding: 60px 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 2px dashed #dee2e6;
}

.espm-ga-no-grupos-content h3 {
    color: #6c757d;
    margin-bottom: 15px;
}

.espm-ga-no-grupos-content p {
    color: #868e96;
    font-size: 1.1em;
}

/* Footer da Dashboard */
.espm-ga-dashboard-footer {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #e1e5e9;
}

.espm-ga-quick-actions h3 {
    text-align: center;
    margin-bottom: 25px;
    color: #2c3e50;
    font-size: 1.5em;
}





/* Telas médias */
@media (max-width: 1024px) and (min-width: 769px) {
    .espm-ga-btn {
        min-width: 120px;
        max-width: 180px;
        font-size: 0.85em;
        padding: 11px 14px;
    }
}

/* Responsividade */
@media (max-width: 768px) {
    .espm-ga-dashboard {
        padding: 15px;
        width: 100%;
        box-sizing: border-box;
    }
    
    .espm-ga-dashboard-header {
        padding: 20px;
        box-sizing: border-box;
    }
    
    .espm-ga-dashboard-header h2 {
        font-size: 2em;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .espm-ga-grupos-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        width: 100%;
        box-sizing: border-box;
    }
    
    .espm-ga-grupo-card {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        padding: 20px;
    }
    
    .espm-ga-grupo-actions {
        flex-direction: column;
        gap: 12px;
        width: 100%;
        box-sizing: border-box;
    }
    
    .espm-ga-btn {
        flex: none;
        min-width: auto;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        font-size: 0.95em;
        padding: 14px 18px;
        white-space: normal;
        word-wrap: break-word;
        line-height: 1.4;
    }
    

}

/* Telas muito pequenas */
@media (max-width: 480px) {
    .espm-ga-dashboard {
        padding: 10px;
    }
    
    .espm-ga-grupo-card {
        padding: 15px;
    }
    
    .espm-ga-btn {
        font-size: 0.9em;
        padding: 14px 16px;
        white-space: normal;
        word-wrap: break-word;
        line-height: 1.4;
    }
    

}

/* Modais */
.espm-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(2px);
}

.espm-modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    animation: espm-modal-slide-in 0.3s ease-out;
}

@keyframes espm-modal-slide-in {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.espm-modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid #e1e5e9;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, var(--espm-primary) 0%, var(--espm-primary-700) 100%);
    color: #fff;
    border-radius: 12px 12px 0 0;
}

.espm-modal-header h3 {
    margin: 0;
    font-size: 1.3em;
    font-weight: 600;
}

.espm-modal-close {
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.espm-modal-close:hover {
    opacity: 1;
}

.espm-modal-body {
    padding: 25px;
    line-height: 1.6;
    max-height: 60vh;
    overflow-y: auto;
}

.espm-modal-body ul {
    margin: 15px 0;
    padding-left: 20px;
}

.espm-modal-body li {
    margin-bottom: 8px;
}

.espm-modal-footer {
    padding: 20px 25px;
    border-top: 1px solid #e1e5e9;
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    background: #f8f9fa;
    border-radius: 0 0 12px 12px;
}

.espm-modal-open {
    overflow: hidden;
}

/* Mensagens */
.espm-ga-message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    z-index: 1001;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    max-width: 300px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.espm-ga-message.show {
    transform: translateX(0);
}

.espm-ga-message-info {
    background: #3498db;
}

.espm-ga-message-success {
    background: #27ae60;
}

.espm-ga-message-warning {
    background: #f39c12;
}

.espm-ga-message-error {
    background: #e74c3c;
}

/* Efeito ripple */
.espm-ga-ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,0.6);
    transform: scale(0);
    animation: espm-ripple 0.6s linear;
    pointer-events: none;
}

@keyframes espm-ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Modal grande para gerenciamento de membros */
.espm-modal-large .espm-modal-content {
    max-width: 1200px;
    width: 98%;
    min-width: 1000px;
    max-height: 90vh;
    overflow-y: auto;
}

/* Estilos para gerenciamento de membros */
.espm-search-user-section,
.espm-create-user-section,
.espm-members-section {
    margin-bottom: 30px;
    padding: 20px;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    background-color: #f8f9fa;
}

.espm-search-user-section h4,
.espm-create-user-section h4,
.espm-members-section h4 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 1.1em;
    font-weight: 600;
}

/* Campo de busca de usuário existente */
.espm-search-user-input {
    width: 100%;
    padding: 12px;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 10px;
    transition: border-color 0.3s;
}

.espm-search-user-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.espm-search-user-results {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    display: none;
}

.espm-search-user-results:not(:empty) {
    display: block;
}

.espm-search-user-item {
    padding: 12px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s;
}

.espm-search-user-item:hover {
    background-color: #f0f0f0;
}

.espm-search-user-item:last-child {
    border-bottom: none;
}

.espm-search-loading,
.espm-search-no-results,
.espm-search-error {
    padding: 12px;
    text-align: center;
    color: #666;
}

.espm-search-error {
    color: #dc3545;
}

/* Formulário de criação de usuário */
.espm-create-user-form {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e1e5e9;
}

.espm-form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.espm-form-group {
    flex: 1;
    min-width: 200px;
}

.espm-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

.espm-form-group input,
.espm-form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background-color: white;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.espm-form-group input:focus,
.espm-form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.espm-form-group button {
    margin-top: 20px;
    padding: 12px 24px;
    font-size: 14px;
}

.espm-search-results {
    margin-top: 15px;
}

.espm-users-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.espm-user-item {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: white;
}

.espm-user-item:hover {
    border-color: #667eea;
    background-color: #f0f2ff;
}

.espm-user-item.selected {
    border-color: #667eea;
    background-color: #e6f0ff;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.2);
}

.espm-user-info strong {
    color: #2c3e50;
    font-size: 14px;
}

.espm-user-info small {
    color: #7f8c8d;
    font-size: 12px;
}

.espm-no-results,
.espm-no-members {
    text-align: center;
    color: #7f8c8d;
    font-style: italic;
    padding: 20px;
}

/* Tabela de membros */
.espm-members-table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.espm-members-table th,
.espm-members-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e1e5e9;
    box-sizing: border-box;
    vertical-align: top;
}

/* Larguras específicas para cada coluna - mais generosas */
.espm-members-table th:nth-child(1),
.espm-members-table td:nth-child(1) {
    width: 20%; /* Nome */
    min-width: 150px;
}

.espm-members-table th:nth-child(2),
.espm-members-table td:nth-child(2) {
    width: 25%; /* Email */
    min-width: 200px;
}

.espm-members-table th:nth-child(3),
.espm-members-table td:nth-child(3) {
    width: 15%; /* Papel */
    min-width: 120px;
}

.espm-members-table th:nth-child(4),
.espm-members-table td:nth-child(4) {
    width: 15%; /* Data de Entrada */
    min-width: 120px;
}

.espm-members-table th:nth-child(5),
.espm-members-table td:nth-child(5) {
    width: 25%; /* Ações */
    min-width: 250px;
}

.espm-members-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

.espm-members-table td {
    font-size: 14px;
    color: #555;
}

.espm-members-table tr:hover {
    background-color: #f8f9fa;
}

/* Badges de papel */
.espm-role-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 120px;
    box-sizing: border-box;
    display: inline-block;
}

.espm-role-badge.representante {
    background-color: #e74c3c;
    color: white;
}

.espm-role-badge.membro {
    background-color: #3498db;
    color: white;
}

/* Ações de membros */
.espm-member-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    min-width: 250px;
    width: 100%;
}

.espm-role-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    background-color: white;
    min-width: 120px;
    max-width: 150px;
    box-sizing: border-box;
    flex-shrink: 0;
}

.espm-ga-btn-danger {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    min-width: 100px;
    max-width: 120px;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    white-space: nowrap;
}

.espm-ga-btn-danger:hover {
    background-color: #c0392b;
}

/* Responsividade para o modal de membros */
@media (max-width: 1024px) {
    .espm-modal-large .espm-modal-content {
        width: 95%;
        margin: 2% auto;
        min-width: 800px;
        max-height: 85vh;
    }
    
    .espm-modal-body {
        max-height: 50vh;
    }
}

@media (max-width: 768px) {
    .espm-modal-large .espm-modal-content {
        width: 98%;
        margin: 1% auto;
        min-width: 600px;
        max-height: 80vh;
    }
    
    .espm-modal-body {
        max-height: 45vh;
    }
    
    .espm-form-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .espm-form-group {
        min-width: auto;
    }
    
    .espm-members-table {
        font-size: 12px;
    }
    
    .espm-members-table th,
    .espm-members-table td {
        padding: 8px;
    }
    
    /* Larguras específicas para mobile - mais generosas */
    .espm-members-table th:nth-child(1),
    .espm-members-table td:nth-child(1) {
        width: 18%;
        min-width: 120px;
    }
    
    .espm-members-table th:nth-child(2),
    .espm-members-table td:nth-child(2) {
        width: 22%;
        min-width: 150px;
    }
    
    .espm-members-table th:nth-child(3),
    .espm-members-table td:nth-child(3) {
        width: 15%;
        min-width: 100px;
    }
    
    .espm-members-table th:nth-child(4),
    .espm-members-table td:nth-child(4) {
        width: 15%;
        min-width: 100px;
    }
    
    .espm-members-table th:nth-child(5),
    .espm-members-table td:nth-child(5) {
        width: 30%;
        min-width: 200px;
    }
    
    .espm-member-actions {
        flex-direction: column;
        gap: 8px;
        min-width: 200px;
    }
    
    .espm-role-select {
        width: 100%;
        min-width: auto;
        max-width: 120px;
    }
    
    .espm-ga-btn-danger {
        width: 100%;
        min-width: auto;
        max-width: 120px;
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .espm-ga-btn {
        max-width: 100%;
        white-space: normal;
        word-wrap: break-word;
        overflow-wrap: break-word;
        line-height: 1.2;
        padding: 10px 12px;
    }
    
    .espm-role-badge {
    max-width: 100px;
    font-size: 10px;
}
}

/* Estilos para o Modal de Perfil */
.espm-profile-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e1e5e9;
}

/* Estilos para o Modal de Gerenciamento de Grupo */
.espm-group-edit-section {
    margin-bottom: 30px;
}

.espm-group-edit-section h4 {
    margin: 0 0 20px 0;
    color: #2c3e50;
    font-size: 1.3em;
    font-weight: 600;
}

.espm-edit-group-form {
    max-width: 100%;
}

.espm-edit-group-form .espm-form-group {
    margin-bottom: 25px;
}

.espm-edit-group-form .espm-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #34495e;
    font-size: 14px;
}

.espm-edit-group-form .espm-form-group input,
.espm-edit-group-form .espm-form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
    font-family: inherit;
}

.espm-edit-group-form .espm-form-group input:focus,
.espm-edit-group-form .espm-form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.espm-edit-group-form .espm-form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* Container de upload de imagem */
.espm-image-upload-container {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    background-color: #f8f9fa;
    transition: border-color 0.3s ease;
}

.espm-image-upload-container:hover {
    border-color: #3498db;
}

.espm-current-image {
    margin-bottom: 15px;
}

.espm-current-image img {
    max-width: 200px;
    max-height: 150px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.espm-current-image p {
    margin: 0;
    color: #7f8c8d;
    font-style: italic;
}

.espm-image-upload-container .espm-ga-btn {
    margin: 0 5px;
}

/* Ações do formulário */
.espm-form-actions {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e1e5e9;
    text-align: right;
}

.espm-form-actions .espm-ga-btn {
    min-width: 150px;
}

.espm-profile-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.espm-profile-section h4 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 1.2em;
    font-weight: 600;
}

.espm-profile-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.espm-profile-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.espm-profile-field label {
    font-weight: 600;
    color: #34495e;
    font-size: 0.9em;
}

.espm-profile-field span {
    color: #2c3e50;
    font-size: 1em;
    padding: 8px 12px;
    background-color: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #e1e5e9;
}

.espm-change-password-form {
    max-width: 500px;
}

.espm-change-password-form .espm-form-group {
    margin-bottom: 20px;
}

.espm-change-password-form .espm-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #34495e;
}

.espm-change-password-form .espm-form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.espm-change-password-form .espm-form-group input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.espm-form-actions {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #e1e5e9;
}

.espm-form-actions .espm-ga-btn {
    min-width: 150px;
}

/* Responsividade para o modal de perfil */
@media (max-width: 768px) {
    .espm-ga-header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .espm-ga-header-info {
        text-align: center;
        min-width: auto;
    }
    
    .espm-ga-header-actions {
        justify-content: center;
    }
    
    .espm-profile-info {
        grid-template-columns: 1fr;
    }
    
    .espm-change-password-form {
        max-width: 100%;
    }
}

/* ========================================
   CONTENT CREATION MODAL
   ======================================== */

/* Editor de conteúdo */
.espm-content-editor {
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    margin-bottom: 15px;
}

.espm-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding: 10px;
    background: #f8f9fa;
    border-bottom: 1px solid #ddd;
    border-radius: 4px 4px 0 0;
}

.espm-editor-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.espm-editor-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.espm-editor-btn:active,
.espm-editor-btn.active {
    background: #007cba;
    color: #fff;
    border-color: #007cba;
}

.espm-editor-body {
    min-height: 200px;
    padding: 15px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    outline: none;
    border: none;
    resize: vertical;
}

.espm-editor-body:empty:before {
    content: attr(data-placeholder);
    color: #999;
    font-style: italic;
}

.espm-editor-body:focus:before {
    content: none;
}

/* Formulário de criação de conteúdo */
.espm-create-content-form {
    max-width: 100%;
}

.espm-user-role-info {
    background: #f8f9fa;
    padding: 10px 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    border-left: 4px solid var(--espm-primary);
}

.espm-user-role-info p {
    margin: 0;
    font-size: 14px;
    color: #495057;
}

/* Preview de arquivos */
.espm-files-preview {
    margin-top: 10px;
}

.espm-file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    margin-bottom: 5px;
}

.espm-file-name {
    font-weight: 500;
    color: #495057;
    flex: 1;
    margin-right: 10px;
}

.espm-file-size {
    color: #6c757d;
    font-size: 12px;
    margin-right: 10px;
}

.espm-remove-file {
    background: #dc3545;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
}

.espm-remove-file:hover {
    background: #c82333;
}

/* Modal de adicionar categoria */
.espm-add-category-modal .espm-modal-content {
    max-width: 500px;
}

/* Botão de nova categoria */
#espm-add-category {
    margin-top: 5px;
    font-size: 12px;
    padding: 5px 10px;
}

/* Seção de categoria pai */
.espm-parent-category-section {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    background: #f8f9fa;
}

.espm-parent-category-info {
    margin-bottom: 10px;
}

.espm-parent-category-display h5 {
    margin: 0 0 5px 0;
    color: #495057;
    font-size: 16px;
}

.espm-category-description {
    margin: 0;
    color: #6c757d;
    font-size: 14px;
}

.espm-no-category {
    margin: 0;
    color: #6c757d;
    font-style: italic;
}

/* Editor WYSIWYG */
.espm-wysiwyg-textarea {
    width: 100%;
    min-height: 200px;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
}

#espm-wysiwyg-container {
    position: relative;
}

/* Estilos para o TinyMCE */
.mce-tinymce {
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
}

.mce-toolbar {
    background: #f8f9fa !important;
    border-bottom: 1px solid #ddd !important;
}

.mce-btn {
    background: #fff !important;
    border: 1px solid #ddd !important;
    border-radius: 3px !important;
}

.mce-btn:hover {
    background: #e9ecef !important;
}

.mce-btn.mce-active {
    background: #007cba !important;
    color: #fff !important;
}

.mce-edit-area {
    border: none !important;
}

.mce-content-body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    font-size: 14px !important;
    line-height: 1.6 !important;
    color: #333 !important;
}

/* Responsividade para editor */
@media (max-width: 768px) {
    .espm-editor-toolbar {
        gap: 3px;
        padding: 8px;
    }
    
    .espm-editor-btn {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    
    .espm-editor-body {
        min-height: 150px;
        padding: 10px;
        font-size: 13px;
    }
    
    .espm-file-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .espm-file-name,
    .espm-file-size {
        margin-right: 0;
    }
}

/* Lista de conteúdos do usuário */
.espm-user-contents-list {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px;
}

.espm-user-content-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.3s ease;
}

.espm-user-content-item:last-child {
    border-bottom: none;
}

.espm-user-content-item:hover {
    background-color: #f8f9fa;
}

.espm-content-info {
    display: flex;
    align-items: center;
    flex: 1;
    gap: 15px;
}

.espm-content-thumbnail {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.espm-content-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.espm-content-details {
    flex: 1;
}

.espm-content-details h5 {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.espm-content-excerpt {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: #666;
    line-height: 1.4;
}

.espm-content-meta {
    display: flex;
    gap: 15px;
    font-size: 12px;
    color: #999;
}

.espm-content-category {
    background: var(--espm-primary-100);
    color: var(--espm-primary-700);
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 500;
}

.espm-content-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.espm-ga-btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    min-width: auto;
}

/* Mensagem de nenhum conteúdo */
.espm-no-contents {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.espm-no-contents-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.espm-no-contents h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 18px;
}

.espm-no-contents p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
}

/* Responsividade para conteúdos do usuário */
@media (max-width: 768px) {
    .espm-user-content-item {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .espm-content-info {
        flex-direction: column;
        text-align: center;
    }
    
    .espm-content-actions {
        justify-content: center;
    }
}

/* Abas (nav-tabs) da dashboard */
.espm-ga-dashboard .nav-tab-wrapper {
    margin: 16px 0 24px 0;
    border-bottom: 1px solid var(--espm-neutral-200);
}

.espm-ga-dashboard .nav-tab-wrapper .nav-tab {
    display: inline-block;
    padding: 8px 14px;
    margin: 0 6px 0 0;
    border: 1px solid var(--espm-neutral-200);
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    background: #fff;
    color: #334155;
    text-decoration: none;
    font-weight: 500;
}

.espm-ga-dashboard .nav-tab-wrapper .nav-tab:hover {
    background: var(--espm-neutral-100);
}

.espm-ga-dashboard .nav-tab-wrapper .nav-tab.nav-tab-active {
    background: var(--espm-primary);
    color: #fff;
    border-color: var(--espm-primary);
}
.espm-grupos-count {
    text-align: right;
    color: #64748b;
    font-size: 12px;
    margin-bottom: 8px;
}

/* =========================
   Lista de Grupos (Tabela)
   ========================= */
.espm-grupos-list { margin-top: 0; }

.espm-grupos-count {
    text-align: right;
    color: #646970;
    font-size: 13px;
    margin-bottom: 10px;
    padding: 0 20px;
}

.espm-grupos-list .wp-list-table {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 0;
    overflow: visible !important;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
    position: static !important;
}

.espm-grupos-list .wp-list-table thead th {
    background: #f6f7f7;
    color: #2c3338;
    border-bottom: 1px solid #c3c4c7;
    font-weight: 600;
    padding: 8px 10px;
    font-size: 13px;
}

.espm-grupos-list .wp-list-table tbody td,
.espm-grupos-list .wp-list-table tfoot th {
    padding: 10px;
    vertical-align: middle;
    border-bottom: 1px solid #f0f0f1;
    font-size: 13px;
    overflow: visible !important;
}

.espm-grupos-list .wp-list-table tbody tr {
    position: static !important;
}

.espm-grupos-list .wp-list-table tbody tr:hover {
    background: #f6f7f7;
}

.espm-grupos-list .column-primary a { 
    color: var(--espm-primary); 
    font-weight: 600;
    text-decoration: none;
}

.espm-grupos-list .column-primary a:hover { 
    color: var(--espm-primary-600); 
}

.espm-grupos-list .row-actions {
    color: #646970;
    font-size: 13px;
}

.espm-grupos-list .row-actions a {
    color: var(--espm-primary);
    text-decoration: none;
}

.espm-grupos-list .row-actions a:hover {
    color: var(--espm-primary-600);
}

.espm-grupos-list .column-actions .button {
    background: var(--espm-primary);
    color: #fff !important;
    border: 1px solid var(--espm-primary);
    border-radius: 3px;
    padding: 6px 10px;
    line-height: 1.5;
    display: inline-block;
    margin: 0 0 8px 0;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
}

.espm-grupos-list .column-actions .button:hover { 
    background: var(--espm-primary-600);
    border-color: var(--espm-primary-600);
}

.espm-grupos-list .column-actions .row-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
}

/* Dropdown de ações */
.column-actions {
    position: static !important;
    overflow: visible !important;
}

.espm-actions-dropdown {
    position: relative;
    z-index: 1000;
}

.espm-actions-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    font-size: 13px;
    background: #f6f7f7;
    border: 1px solid #c3c4c7;
    border-radius: 3px;
    cursor: pointer;
    color: #2c3338;
    position: relative;
    z-index: 1;
}

.espm-actions-toggle:hover {
    background: #fff;
    border-color: var(--espm-primary);
    color: var(--espm-primary);
}

.espm-actions-toggle .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.espm-actions-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 200px;
    z-index: 99999999 !important;
    overflow: hidden;
}

.espm-actions-dropdown.active {
    z-index: 10000;
}

.espm-actions-dropdown.active .espm-actions-menu {
    display: block;
}

.espm-action-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    color: #2c3338;
    text-decoration: none;
    font-size: 13px;
    border-bottom: 1px solid #f0f0f1;
    transition: background-color 0.1s ease;
}

.espm-action-item:last-child {
    border-bottom: none;
}

.espm-action-item:hover {
    background: #f6f7f7;
    color: var(--espm-primary);
}

.espm-action-item .dashicons {
    color: #646970;
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.espm-action-item:hover .dashicons {
    color: var(--espm-primary);
}

/* Badges de papel */
.espm-role-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
}

.espm-role-badge.representante,
.espm-role-badge.admin {
    background: #fcf0f1;
    color: #A60F36;
    border: 1px solid #f8d7da;
}

.espm-role-badge.membro {
    background: #f0f0f1;
    color: #50575e;
    border: 1px solid #dcdcde;
}

/* Badges de status de conteúdo */
.espm-status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
}

.espm-status-badge.espm-status-publish {
    background: #e6f4ea;
    color: #137333;
    border: 1px solid #c6e6cb;
}

.espm-status-badge.espm-status-draft {
    background: #fef7e0;
    color: #7f6003;
    border: 1px solid #f9edbe;
}

.espm-status-badge.espm-status-pending {
    background: #e3f2fd;
    color: #0d47a1;
    border: 1px solid #bbdefb;
}

/* Lista de conteúdos */
.espm-conteudos-list {
    margin-top: 0;
    padding: 20px;
}

/* Filtro por grupo */
.espm-filter-group {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding: 16px;
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
}

.espm-filter-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    font-weight: 600;
    font-size: 13px;
    color: #1d2327;
}

.espm-filter-group label .dashicons {
    color: var(--espm-primary);
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.espm-grupo-filter-select {
    flex: 1;
    max-width: 400px;
    padding: 6px 10px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    font-size: 13px;
    line-height: 2;
    min-height: 30px;
}

.espm-grupo-filter-select:focus {
    border-color: var(--espm-primary);
    outline: none;
    box-shadow: 0 0 0 1px var(--espm-primary);
}

/* Estado vazio */
.espm-empty-state {
    text-align: center;
    padding: 60px 20px;
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
}

.espm-empty-state .dashicons {
    font-size: 64px;
    width: 64px;
    height: 64px;
    color: #c3c4c7;
    margin-bottom: 16px;
}

.espm-empty-state p {
    margin: 8px 0;
    font-size: 14px;
    color: #1d2327;
}

.espm-empty-state p.description {
    color: #646970;
    font-size: 13px;
}

/* Sem permissão */
.espm-no-permission {
    text-align: center;
    padding: 60px 20px;
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    margin: 20px 0;
}

.espm-no-permission .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: #d63638;
    margin-bottom: 12px;
}

.espm-no-permission p {
    margin: 8px 0;
    font-size: 14px;
    color: #1d2327;
}