/* ============================================
   RESET E CONFIGURAÇÕES GERAIS
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    color: #333;
}

/* ============================================
   PÁGINA INDEX.PHP - TELA INICIAL
   ============================================ */
body.index-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.container {
    background: white;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 60px 80px;
    max-width: 800px;
    width: 100%;
    text-align: center;
    animation: fadeIn 0.6s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

h1 {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 10px;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: #7f8c8d;
    font-size: 1.1rem;
    margin-bottom: 50px;
    font-weight: 300;
}
.subtitle em {
    color: #CCC;
}

.nav-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 40px;
}

.nav-item {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.nav-item:hover {
    transform: translateY(-5px);
}

.nav-link {
    display: block;
    padding: 20px 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    position: relative;
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.nav-link:hover::before {
    left: 100%;
}

.nav-link:hover {
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
    transform: scale(1.02);
}

.nav-link:active {
    transform: scale(0.98);
}

.nav-link::after {
    content: '→';
    margin-left: 10px;
    display: inline-block;
    transition: transform 0.3s ease;
}

.nav-link:hover::after {
    transform: translateX(5px);
}

/* ============================================
   LAYOUT PRINCIPAL - CONTAINER E MAPA
   ============================================ */
#container {
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    background: #ecf0f1;
}

#map {
    flex-grow: 1;
    height: 100%;
    background: #e8e8e8;
}

/* ============================================
   LOGO
   ============================================ */
.logo-main {
    max-width: 200px;
    height: auto;
    margin: 0 auto 30px auto;
    display: block;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
    animation: fadeIn 0.8s ease-in;
}

.logo-sidebar {
    max-width: 100%;
    height: auto;
    margin: 0 auto 20px auto;
    display: block;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ============================================
   SIDEBAR ESQUERDA
   ============================================ */
#sidebar {
    width: 280px;
    background: linear-gradient(180deg, #1a252f 0%, #2c3e50 50%, #34495e 100%);
    color: white;
    padding: 25px 20px;
    flex-direction: column;
    gap: 20px;
    z-index: 10;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.4);
    overflow-y: auto;
    transition: width 0.3s ease;
    position: relative;
}



/* ============================================
   PAINEL DIREITO
   ============================================ */
#right-panel {
    width: 300px;
    background: linear-gradient(180deg, #1a252f 0%, #2c3e50 50%, #34495e 100%);
    color: white;
    padding: 25px 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    z-index: 10;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.4);
    overflow-y: auto;
    position: relative;
}


#right-panel h3 {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 15px 0;
    color: #ecf0f1;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding-bottom: 10px;
    padding-top: 15px;
    text-align: center;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    position: relative;
}

#right-panel h3::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 50px;
    height: 2px;
    background: linear-gradient(90deg, #3498db, transparent);
}

#right-panel h4 {
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 10px 0;
    color: #3498db;
    display: flex;
    align-items: center;
    gap: 8px;
}

#right-panel h4::before {
    content: '📍';
    font-size: 16px;
}

#right-panel > div {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

#right-panel > div:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateX(5px);
}

#right-panel p {
    margin: 8px 0;
    color: #bdc3c7;
    font-size: 14px;
    line-height: 1.6;
}

#right-panel strong {
    color: #ecf0f1;
    font-weight: 600;
}

/* Botão "Limpar mapa" no topo do right-panel (modo analista) */
.right-panel-toolbar.right-panel-toolbar-analista {
    margin-bottom: 16px;
}
.btn-limpar-mapa-analista {
    width: 100%;
    padding: 10px 16px;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3);
}
.btn-limpar-mapa-analista:hover {
    background: linear-gradient(135deg, #c0392b 0%, #e74c3c 100%);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.4);
}


/* ============================================
   ITENS ARRASTÁVEIS (DRAG & DROP)
   ============================================ */
.drag-item {
    padding: 14px 16px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.1) 100%);
    color: white;
    cursor: grab;
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    margin-bottom: 10px;
    position: relative;
    overflow: hidden;
}

.drag-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, #3498db, #2ecc71);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.drag-item:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0.15) 100%);
    transform: translateX(8px) scale(1.02);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.4);
}

.drag-item:hover::before {
    transform: scaleY(1);
}

.drag-item:active {
    cursor: grabbing;
    transform: translateX(8px) scale(0.98);
}

.drag-item img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.drag-item-content {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
}

.portfolio-info-icon {
    cursor: pointer;
    font-size: 18px;
    padding: 4px 8px;
    transition: all 0.2s ease;
    user-select: none;
    opacity: 0.7;
    display: flex;
    align-items: center;
    justify-content: center;
}

.portfolio-info-icon:hover {
    opacity: 1;
    transform: scale(1.2);
}

.portfolio-tooltip {
    position: absolute;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    min-width: 250px;
    max-width: 300px;
    z-index: 10000;
    animation: tooltipFadeIn 0.3s ease;
    backdrop-filter: blur(10px);
    margin-top: 5px;
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.portfolio-tooltip-content {
    padding: 0;
    overflow: hidden;
}

.portfolio-tooltip-header {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    font-size: 14px;
    font-weight: 600;
}

.portfolio-tooltip-close {
    cursor: pointer;
    font-size: 20px;
    font-weight: bold;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s ease;
    user-select: none;
}

.portfolio-tooltip-close:hover {
    opacity: 1;
    transform: scale(1.2);
}

.portfolio-tooltip-body {
    padding: 16px;
    color: #ecf0f1;
    font-size: 14px;
    line-height: 1.6;
}

.portfolio-tooltip-body p {
    margin: 0;
    padding: 4px 0;
}

.portfolio-tooltip-body strong {
    color: #3498db;
    font-weight: 600;
}

/* ============================================
   BOTÕES
   ============================================ */
#btn-desenho {
    padding: 16px 24px;
    cursor: pointer;
    border: none;
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    color: white;
    font-weight: 700;
    font-size: 15px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(46, 204, 113, 0.4);
    width: 100%;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.5px;

}


#btn-desenho:hover {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(46, 204, 113, 0.6);
}

#btn-desenho:hover::before {
    transform: rotate(15deg) scale(1.2);
}

#btn-desenho:active {
    transform: translateY(-1px);
}

#btn-relatorio,
#btn-relatorio-portfolios,
#btn-relatorio-portfolios-total,
#btn-relatorio-ppt-cristiano,
#btn-relatorio-ppt-planos {
    padding: 16px 24px;
    cursor: pointer;
    border: none;
    color: white;
    font-weight: normal;
    font-size: 12px;
    transition: all 0.3s ease;
    width: 100%;
    margin-top: 10px;
    position: relative;
    overflow: hidden;
    text-transform: none;
    letter-spacing: normal;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #333333;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#btn-relatorio:hover,
#btn-relatorio-portfolios:hover,
#btn-relatorio-portfolios-total:hover,
#btn-relatorio-ppt-cristiano:hover,
#btn-relatorio-ppt-planos:hover {
    background: #444444;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

#btn-relatorio:active,
#btn-relatorio-portfolios:active,
#btn-relatorio-portfolios-total:active,
#btn-relatorio-ppt-cristiano:active,
#btn-relatorio-ppt-planos:active {
    transform: translateY(0);
}

.btn-acao {
    padding: 8px 14px;
    margin: 4px 2px;
    border: none;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-acao:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.btn-acao:active {
    transform: translateY(0);
}

.btn-editar {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
}

.btn-editar:hover {
    background: linear-gradient(135deg, #2980b9 0%, #3498db 100%);
}

.btn-deletar {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
}

.btn-deletar:hover {
    background: linear-gradient(135deg, #c0392b 0%, #e74c3c 100%);
}

.btn-salvar {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    color: white;
}

.btn-salvar:hover {
    background: linear-gradient(135deg, #229954 0%, #27ae60 100%);
}

.btn-cancelar {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
    color: white;
}

.btn-cancelar:hover {
    background: linear-gradient(135deg, #7f8c8d 0%, #95a5a6 100%);
}

/* ============================================
   FORMULÁRIOS E INPUTS
   ============================================ */
select {
    padding: 12px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    outline: none;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 14px;
    width: 100%;
    transition: all 0.3s ease;
    cursor: pointer;
}

select:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

select:focus {
    background: rgba(255, 255, 255, 0.2);
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

select option {
    background: #2c3e50;
    color: white;
    padding: 10px;
}

/* ============================================
   TELA DE LOGIN
   ============================================ */
#login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
}

#login-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.login-box {
    background: white;
    padding: 50px 40px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-box h2 {
    margin: 0 0 30px 0;
    color: #2c3e50;
    text-align: center;
    font-size: 1.8rem;
    font-weight: 700;
}

.form-group {
    margin-bottom: 22px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 600;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 14px;
    border: 2px solid #ddd;
    font-size: 14px;
    box-sizing: border-box;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.form-group input:focus {
    outline: none;
    border-color: #3498db;
    background: white;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-group input::placeholder {
    color: #95a5a6;
}

.btn-login {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border: none;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.btn-login:hover {
    background: linear-gradient(135deg, #2980b9 0%, #3498db 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(52, 152, 219, 0.4);
}

.btn-login:active {
    transform: translateY(0);
}

.btn-login.btn-analista {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.3);
}

.btn-login.btn-analista:hover {
    background: linear-gradient(135deg, #e67e22 0%, #f39c12 100%);
    box-shadow: 0 6px 16px rgba(243, 156, 18, 0.4);
}

#login-mensagem {
    margin-top: 15px;
    color: #e74c3c;
    font-size: 13px;
    padding: 10px;
    background: #fee;
    border: 1px solid #fcc;
    display: none;
}

/* ============================================
   INFORMAÇÕES DO USUÁRIO
   ============================================ */
.user-info {
    padding: 20px;
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.2) 0%, rgba(46, 204, 113, 0.2) 100%);
    margin-bottom: 20px;
    font-size: 14px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.user-info::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.user-info strong {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: #ecf0f1;
}

.user-info #user-name {
    color: #bdc3c7;
    margin-bottom: 10px;
}

.btn-logout {
    padding: 10px 18px;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    width: 100%;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3);
}

.btn-logout:hover {
    background: linear-gradient(135deg, #c0392b 0%, #e74c3c 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.4);
}

.btn-logout:active {
    transform: translateY(0);
}

/* Botão Observações (ambiente representante) */
#observacoes-wrapper {
    margin-bottom: 16px;
}
.btn-observacoes {
    width: 100%;
    padding: 10px 18px;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}
.btn-observacoes:hover {
    background: linear-gradient(135deg, #2980b9 0%, #3498db 100%);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4);
}

/* Popup Observações */
.popup-observacoes-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
}
.popup-observacoes-box {
    background: white;
    border-radius: 12px;
    padding: 24px;
    min-width: 400px;
    max-width: 90%;
    max-height: 90vh;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}
.popup-observacoes-titulo {
    margin: 0 0 16px 0;
    font-size: 18px;
    color: #2c3e50;
}
.popup-observacoes-text {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    margin-bottom: 16px;
}
.popup-observacoes-botoes {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}
.popup-observacoes-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}
.popup-observacoes-btn-salvar {
    background: #27ae60;
    color: white;
}
.popup-observacoes-btn-salvar:hover {
    background: #229954;
}
.popup-observacoes-btn-fechar {
    background: #95a5a6;
    color: white;
}
.popup-observacoes-btn-fechar:hover {
    background: #7f8c8d;
}

/* ============================================
   MENSAGENS E FEEDBACK
   ============================================ */
.mensagem {
    position: fixed;
    bottom: 3px;
    left: 50%;
    transform: translateX(-50%);
    padding: 16px 24px;
    font-size: 14px;
    display: none;
    font-weight: 600;
    z-index: 10000;
    min-width: 300px;
    max-width: 90%;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}


.mensagem.sucesso {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    color: white;
    display: block;
    box-shadow: 0 2px 8px rgba(39, 174, 96, 0.3);
}

.mensagem.erro {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    display: block;
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3);
}

.loading {
    display: none;
    padding: 12px;
    background: rgba(52, 73, 94, 0.8);
    text-align: center;
    font-size: 13px;
    color: white;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.loading.active {
    display: block;
}

/* ============================================
   ELEMENTOS AUXILIARES
   ============================================ */
hr {
    border: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    margin: 20px 0;
    position: relative;
}

hr::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.5);
}

#arraste-para-mapa {
    margin: 0 0 15px 0;
    font-size: 13px;
    color: #ecf0f1;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-left: 4px solid #3498db;
    display: flex;
    align-items: center;
    gap: 8px;
}

#arraste-para-mapa::before {
    content: '👆';
    font-size: 16px;
}

/* ============================================
   RESPONSIVIDADE
   ============================================ */
@media (max-width: 768px) {
    .container {
        padding: 40px 30px;
    }

    h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
        margin-bottom: 30px;
    }

    .nav-link {
        padding: 18px 30px;
        font-size: 1.1rem;
    }

    .logo-main {
        max-width: 150px;
        margin-bottom: 20px;
    }

    .logo-sidebar {
        max-width: 90%;
        padding: 8px;
    }

    #sidebar {
        width: 220px;
        padding: 15px;
    }

    #right-panel {
        width: 220px;
        padding: 15px;
    }
}

/* ============================================
   MELHORIAS ADICIONAIS - EFEITOS E POLIMENTO
   ============================================ */
#sidebar,
#right-panel {
    position: relative;
}

/* Efeito de brilho sutil nos botões */
#btn-desenho,
#btn-relatorio,
#btn-relatorio-portfolios,
#btn-relatorio-portfolios-total,
#btn-relatorio-ppt-cristiano,
#btn-relatorio-ppt-planos,
.btn-logout {
    position: relative;
    overflow: hidden;
}

#btn-desenho::after,
#btn-relatorio::after,
#btn-relatorio-portfolios::after,
#btn-relatorio-portfolios-total::after,
#btn-relatorio-ppt-cristiano::after,
#btn-relatorio-ppt-planos::after,
.btn-logout::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

#btn-desenho:hover::after,
#btn-relatorio:hover::after,
#btn-relatorio-portfolios:hover::after,
#btn-relatorio-portfolios-total:hover::after,
#btn-relatorio-ppt-cristiano:hover::after,
#btn-relatorio-ppt-planos:hover::after,
.btn-logout:hover::after {
    width: 300px;
    height: 300px;
}

/* Melhorias nos inputs do painel direito */
#right-panel input[type="text"],
#right-panel input[type="number"] {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    padding: 10px;
    color: white;
    font-size: 14px;
    transition: all 0.3s ease;
    width: 100%;
    margin-bottom: 10px;
}

#right-panel input[type="text"]:focus,
#right-panel input[type="number"]:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
    outline: none;
}

#right-panel input[type="text"]::placeholder,
#right-panel input[type="number"]::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.input-percentual {
    flex: 1;
    max-width: 100px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    padding: 10px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.input-percentual:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
    outline: none;
}

#right-panel label {
    display: block;
    margin-bottom: 6px;
    color: #bdc3c7;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Melhorias nos botões do painel direito */
#right-panel button {
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    background-color: rgb(76, 175, 80)
}

#right-panel button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

#right-panel button:active {
    transform: translateY(0);
}

/* ============================================
   BOTÕES DO PAINEL DIREITO - SALVAR E EXCLUIR
   ============================================ */
.painel-botoes {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-painel-salvar,
.btn-painel-excluir {
    flex: 1;
    padding: 10px 16px;
    border: none;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.btn-painel-salvar {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
}


.btn-painel-salvar:hover {
    background: linear-gradient(135deg, #2980b9 0%, #1f6391 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4);
}

.btn-painel-salvar:active {
    transform: translateY(0);
}

.btn-painel-excluir {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
}


.btn-painel-excluir:hover {
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.4);
}

.btn-painel-excluir:active {
    transform: translateY(0);
}

/* Efeito de brilho nos botões do painel */
.btn-painel-salvar::after,
.btn-painel-excluir::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-painel-salvar:hover::after,
.btn-painel-excluir:hover::after {
    width: 200px;
    height: 200px;
}

/* ============================================
   INFOWINDOWS - GOOGLE MAPS
   ============================================ */
.infowindow-container {
    color: #2c3e50;
    padding: 0;
    min-width: 280px;
    max-width: 350px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: white;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.infowindow-header {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 18px 20px;
    margin: 0;
    border-bottom: 3px solid #3498db;
    position: relative;
}

.infowindow-header::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #3498db, transparent);
}

.infowindow-header h2,
.infowindow-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.infowindow-header-primary {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    border-bottom-color: #e74c3c;
}

.infowindow-header-primary::after {
    background: linear-gradient(90deg, #e74c3c, transparent);
}

.infowindow-header-secondary {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    border-bottom-color: #3498db;
}

.infowindow-header-secondary::after {
    background: linear-gradient(90deg, #3498db, transparent);
}

.infowindow-header h2 {
    font-size: 14px;
    color: #ecf0f1;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
}

.infowindow-content {
    padding: 20px;
    background: #f8f9fa;
}

.infowindow-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 0;
    border-bottom: 1px solid #e0e0e0;
    font-size: 13px;
}

.infowindow-info:last-child {
    border-bottom: none;
}

.infowindow-info-label {
    color: #7f8c8d;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 80px;
}

.infowindow-info-value {
    color: #2c3e50;
    font-weight: 500;
    flex: 1;
}

.infowindow-form-group {
    margin: 18px 0;
}

.infowindow-form-group label {
    display: block;
    margin-bottom: 8px;
    color: #34495e;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.infowindow-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    font-size: 14px;
    box-sizing: border-box;
    transition: all 0.3s ease;
    background: white;
    color: #2c3e50;
    font-weight: 500;
}

.infowindow-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
    background: #fff;
}

.infowindow-input:disabled {
    background: #ecf0f1;
    color: #95a5a6;
    cursor: not-allowed;
    border-color: #bdc3c7;
}

.infowindow-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.infowindow-btn {
    width: 100%;
    padding: 12px 20px;
    border: none;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.infowindow-btn-primary {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
}



.infowindow-btn-primary:hover {
    background: linear-gradient(135deg, #2980b9 0%, #1f6391 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(52, 152, 219, 0.4);
}

.infowindow-btn-danger {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
}


.infowindow-btn-danger:hover {
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(231, 76, 60, 0.4);
}

.infowindow-btn-success {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    color: white;
}

.infowindow-btn-success:hover {
    background: linear-gradient(135deg, #229954 0%, #1e8449 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(39, 174, 96, 0.4);
}

.infowindow-btn:active {
    transform: translateY(0);
}

.infowindow-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.infowindow-btn-action {
    flex: 1;
    padding: 10px 16px;
    border: none;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.infowindow-btn-action-edit {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
}

.infowindow-btn-action-edit:hover {
    background: linear-gradient(135deg, #2980b9 0%, #1f6391 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4);
}

.infowindow-btn-action-delete {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
}

.infowindow-btn-action-delete:hover {
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.4);
}

.infowindow-message {
    padding: 12px;
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    margin-top: 15px;
    font-size: 12px;
    color: #856404;
    line-height: 1.5;
}

.infowindow-message-info {
    background: #d1ecf1;
    border-left-color: #3498db;
    color: #0c5460;
}

.infowindow-message-warning {
    background: #fff3cd;
    border-left-color: #ffc107;
    color: #856404;
}

/* ============================================
   SOBRESCRITA DE ESTILOS DO GOOGLE MAPS INFOWINDOW
   ============================================ */
.gm-style .gm-style-iw-c {
    padding: 0 !important;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3) !important;
}

.gm-style .gm-style-iw-d {
    overflow: hidden !important;
}

.gm-style .gm-style-iw-t::after {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
}

/* Ajusta o botão de fechar do Google Maps */
.gm-ui-hover-effect {
    opacity: 0.8 !important;
    transition: opacity 0.3s ease !important;
}

.gm-ui-hover-effect:hover {
    opacity: 1 !important;
}

.gm-style .gm-style-iw-tc {
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.2)) !important;
}

@media (max-width: 480px) {
    body.index-page {
        padding: 10px;
    }

    .container {
        padding: 30px 20px;
    }

    h1 {
        font-size: 1.75rem;
    }

    .nav-link {
        padding: 16px 25px;
        font-size: 1rem;
    }

    .logo-main {
        max-width: 120px;
        margin-bottom: 15px;
    }

    .logo-sidebar {
        max-width: 85%;
        padding: 6px;
        margin-bottom: 15px;
    }

    .login-box {
        padding: 40px 25px;
        margin: 20px;
    }

    #sidebar {
        width: 200px;
        padding: 12px;
    }

    #right-panel {
        width: 200px;
        padding: 12px;
    }
}

/* ============================================
   CLASSES AUXILIARES
   ============================================ */
.hidden {
    display: none !important;
}

.btn-full-width {
    width: 100%;
    margin-top: 8px;
}

.btn-analista {
    margin-top: 10px;
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%) !important;
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.3) !important;
}

.btn-analista:hover {
    background: linear-gradient(135deg, #e67e22 0%, #f39c12 100%) !important;
    box-shadow: 0 6px 16px rgba(243, 156, 18, 0.4) !important;
}

/* ============================================
   MELHORIAS GERAIS
   ============================================ */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Transições suaves para todos os elementos interativos */
button, a, input, select {
    transition: all 0.2s ease;
}

/* Foco acessível */
button:focus,
input:focus,
select:focus,
a:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* Melhorias de legibilidade */
p, label, span {
    line-height: 1.6;
}

/* ============================================
   BOTÃO FLUTUANTE PARA ENCERRAR EDIÇÃO
   ============================================ */
.btn-encerrar-edicao {
    position: fixed;
    bottom: 95px;
    left: 50%;
    transform: translate(-50%);
    z-index: 1000;
    background: linear-gradient(135deg, #296e1b 0%, #103a07 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(8, 54, 6, 0.4);
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.btn-encerrar-edicao:hover {
    background: linear-gradient(135deg, #1b4b12 0%, #092204 100%);
    box-shadow: 0 6px 20px rgba(3, 41, 2, 0.4);
}


.btn-encerrar-edicao::before {
    content: "✓";
    font-size: 18px;
    font-weight: bold;
}

/* ============================================
   MELHORIAS PARA PAINEL DIREITO - CARDS E INFORMAÇÕES
   ============================================ */
#right-panel .info-card {
    background: rgba(255, 255, 255, 0.08);
    padding: 18px;
    margin-bottom: 15px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

#right-panel .info-card:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    border-color: rgba(52, 152, 219, 0.5);
}

#right-panel .info-card-title {
    font-size: 16px;
    font-weight: 700;
    color: #3498db;
    margin: 0 0 12px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(52, 152, 219, 0.3);
    display: flex;
    align-items: center;
    gap: 8px;
}

#right-panel .info-item {
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
}

#right-panel .info-item:last-child {
    border-bottom: none;
}

#right-panel .info-item:hover {
    padding-left: 8px;
    background: rgba(255, 255, 255, 0.05);
    margin: 0 -8px;
    padding: 10px 8px;
}

#right-panel .info-label {
    font-size: 12px;
    color: #95a5a6;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    margin-bottom: 4px;
}

#right-panel .info-value {
    font-size: 14px;
    color: #ecf0f1;
    font-weight: 500;
}

/* ============================================
   MELHORIAS PARA SELECT E INPUTS NA SIDEBAR
   ============================================ */
#sidebar select {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 14px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffffff' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}

#sidebar select:hover {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

#sidebar select:focus {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.3);
    outline: none;
}

#sidebar select option {
    background: #2c3e50;
    color: white;
    padding: 12px;
}

/* ============================================
   ANIMAÇÕES E TRANSIÇÕES MELHORADAS
   ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#right-panel > div,
#sidebar > div:not(.user-info) {
    animation: fadeInUp 0.4s ease-out;
}

/* ============================================
   BADGES E INDICADORES
   ============================================ */
.badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(52, 152, 219, 0.3);
    color: #3498db;
    border: 1px solid rgba(52, 152, 219, 0.5);
}

.badge-success {
    background: rgba(46, 204, 113, 0.3);
    color: #2ecc71;
    border-color: rgba(46, 204, 113, 0.5);
}

.badge-warning {
    background: rgba(243, 156, 18, 0.3);
    color: #f39c12;
    border-color: rgba(243, 156, 18, 0.5);
}

.badge-danger {
    background: rgba(231, 76, 60, 0.3);
    color: #e74c3c;
    border-color: rgba(231, 76, 60, 0.5);
}



/* ============================================
   LOGO SIDEBAR MELHORADO
   ============================================ */
.logo-sidebar {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    margin-bottom: 25px;
}

.logo-sidebar:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.25);
    transform: scale(1.02);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}
