/* ==========================================
   1. VARIÁVEIS GLOBAIS E TEMAS (Cores do Sistema)
   ========================================== */

:root {
    --bg-dark: #0a0a0a;
    --bg-card: #141414;
    --primary: #00f3ff;
    --primary-glow: rgba(0, 243, 255, 0.4);
    --primary-dim: rgba(0, 243, 255, 0.05);
    --text-main: #ffffff;
    --text-dim: #a1a1aa;
    --success: #00ff9d;
    --danger: #ff2a2a;
    --border: 1px solid rgba(255, 255, 255, 0.1);
}

/* TEMA MIDNIGHT: Tons de roxo profundo, mais relaxante */
body.theme-midnight {
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --primary: #8b5cf6;
    --primary-glow: rgba(139, 92, 246, 0.3);
    --primary-dim: rgba(139, 92, 246, 0.05);
    --text-dim: #94a3b8;
    --border: 1px solid rgba(139, 92, 246, 0.2);
}

body.theme-midnight .main-panel {
    background: radial-gradient(circle at top right, #1e1b4b 0%, #0f172a 60%) !important;
}

/* TEMA EMERALD: Verde floresta, alta legibilidade */
body.theme-emerald {
    --bg-dark: #022c22;
    --bg-card: #064e3b;
    --primary: #10b981;
    --primary-glow: rgba(16, 185, 129, 0.3);
    --primary-dim: rgba(16, 185, 129, 0.05);
    --border: 1px solid rgba(16, 185, 129, 0.2);
}

body.theme-emerald .main-panel {
    background: radial-gradient(circle at top right, #065f46 0%, #022c22 60%) !important;
}

/* TEMA STARK WHITE (LIGHT): Visual limpo e profissional */
body.theme-light {
    --bg-dark: #f8fafc;
    --bg-card: #ffffff;
    --primary: #0284c7;
    --primary-glow: rgba(2, 132, 199, 0.1);
    --primary-dim: rgba(2, 132, 199, 0.05);
    --text-main: #0f172a;
    --text-dim: #64748b;
    --success: #059669;
    --danger: #dc2626;
    --border: 1px solid #e2e8f0;
}

body.theme-light .main-panel {
    background: radial-gradient(circle at top right, #e2e8f0 0%, #f8fafc 60%) !important;
}

body.theme-light .sidebar,
body.theme-light .chat-sidebar {
    background: var(--bg-card) !important;
    border-color: #e2e8f0 !important;
}

body.theme-light .nav-btn {
    color: #64748b;
}


/* ==========================================
   2. ESTRUTURA GLOBAL E LOGIN
   ========================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
    display: flex;
}

/* Tela de Login */
#login-overlay {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background-image: radial-gradient(circle at center, #112 0%, #000 80%);
}

.login-box {
    width: 350px;
    text-align: center;
    padding: 40px;
    border: 1px solid var(--primary);
    background: rgba(10, 10, 10, 0.9);
    box-shadow: 0 0 50px rgba(0, 243, 255, 0.1);
}

.stark-input {
    width: 100%;
    padding: 15px;
    margin: 10px 0;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #333;
    color: var(--primary);
    font-family: 'JetBrains Mono';
    outline: none;
    text-align: center;
    transition: 0.3s;
}

.stark-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 15px var(--primary-dim);
}

.stark-btn {
    width: 100%;
    padding: 15px;
    background: var(--primary);
    border: none;
    color: #000;
    font-weight: 800;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-family: 'JetBrains Mono';
    margin-top: 10px;
}

.stark-btn:hover {
    box-shadow: 0 0 20px var(--primary);
}


/* ==========================================
   3. MENU LATERAL (SIDEBAR)
   ========================================== */

.sidebar {
    width: 80px;
    background: var(--bg-card);
    /* Ajustado para variável dinâmica */
    border-right: var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 25px 0;
    z-index: 10;
}

.logo-icon {
    font-size: 1.8rem;
    color: var(--primary);
    margin-bottom: 40px;
    filter: drop-shadow(0 0 10px var(--primary-glow));
}

.nav-btn {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
    border-radius: 8px;
    margin-bottom: 20px;
    cursor: pointer;
    transition: 0.3s;
    position: relative;
}

.nav-btn:hover,
.nav-btn.active {
    color: var(--primary);
    background: var(--primary-dim);
    box-shadow: 0 0 15px var(--primary-dim);
}

.nav-btn.active::after {
    content: '';
    position: absolute;
    right: -17px;
    width: 3px;
    height: 100%;
    background: var(--primary);
    box-shadow: 0 0 10px var(--primary);
}


/* ==========================================
   4. PAINEL PRINCIPAL E CABEÇALHO (Top Bar)
   ========================================== */

.main-panel {
    flex: 1;
    min-width: 0;
    padding: 30px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    background: radial-gradient(circle at top right, #1a1a1a 0%, #0a0a0a 50%);
    opacity: 0;
    transition: opacity 1s;
    width: 100%;
    max-width: 100vw;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 30px;
    border-bottom: var(--border);
    padding-bottom: 20px;
}

.page-title h1 {
    font-weight: 300;
    font-size: 2rem;
    letter-spacing: 1px;
    color: var(--text-main);
}

.page-title span {
    color: var(--primary);
    font-weight: 800;
    font-family: 'JetBrains Mono';
}

.date-display {
    text-align: right;
    font-family: 'JetBrains Mono';
    font-size: 0.8rem;
    color: var(--text-dim);
}

.live-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--success);
    font-weight: bold;
    font-size: 0.7rem;
    border: 1px solid rgba(0, 255, 157, 0.3);
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(0, 255, 157, 0.1);
}

/* Animação do Ponto Verde (Live) */
.blink {
    animation: blinker 1.5s linear infinite;
}

div.blink {
    width: 6px;
    height: 6px;
    background: var(--success);
    border-radius: 50%;
}

@keyframes blinker {
    50% {
        opacity: 0;
    }
}

/* Lógica das Abas */
.view-section {
    display: none;
    animation: fadeIn 0.5s;
    width: 100%;
}

.view-section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* ==========================================
   5. DASHBOARD: KPIs, Gráfico e Radar
   ========================================== */

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.kpi-card {
    background: var(--bg-card);
    border: var(--border);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), transparent);
}

.kpi-label {
    font-family: 'JetBrains Mono';
    font-size: 0.7rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
}

.kpi-value {
    font-family: 'JetBrains Mono';
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-main);
    /* Mudado para variável dinâmica */
    transition: 0.3s;
}

.kpi-delta {
    font-size: 0.7rem;
    color: var(--success);
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Gráfico */
.chart-container {
    background: var(--bg-card);
    border: var(--border);
    padding: 20px;
    border-radius: 4px;
    height: 350px;
    position: relative;
    margin-bottom: 30px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
}

/* Radar e Ferramentas */
.tools-grid {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
    max-width: 100%;
    gap: 20px;
}

.tool-card {
    background: var(--bg-card);
    border: var(--border);
    padding: 20px;
    display: flex;
    flex-direction: column;
    height: 450px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
}

.tool-header {
    font-family: 'JetBrains Mono';
    color: var(--primary);
    margin-bottom: 15px;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(150, 150, 150, 0.2);
    padding-bottom: 10px;
}

#radar-list {
    flex: 1;
    overflow-y: auto;
    font-family: 'JetBrains Mono';
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-bottom: 10px;
}

.radar-item {
    padding: 8px 0;
    border-bottom: 1px solid rgba(150, 150, 150, 0.2);
    display: flex;
    justify-content: space-between;
}

.action-btn {
    background: rgba(0, 243, 255, 0.05);
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 10px;
    font-family: 'JetBrains Mono';
    font-size: 0.8rem;
    cursor: pointer;
    transition: 0.3s;
    margin-top: auto;
    text-align: center;
}

.action-btn:hover {
    background: var(--primary);
    color: #000;
    box-shadow: 0 0 15px var(--primary-glow);
}


/* ==========================================
   6. TRIAGEM IA (Kanban Board)
   ========================================== */

.kanban-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    height: 600px;
}

.kanban-col {
    background: rgba(150, 150, 150, 0.02);
    border: var(--border);
    border-radius: 4px;
    display: flex;
    flex-direction: column;
}

.kanban-header {
    padding: 15px;
    font-family: 'JetBrains Mono';
    font-size: 0.8rem;
    font-weight: bold;
    border-bottom: var(--border);
    color: var(--text-main);
    /* Mudado para variável */
}

.kanban-body {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
}

.kanban-card {
    background: var(--bg-card);
    /* Ajustado */
    border-left: 3px solid var(--primary);
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 2px;
    transition: 0.2s;
    position: relative;
    border-top: var(--border);
    border-right: var(--border);
    border-bottom: var(--border);
}

.kanban-card:hover {
    transform: translateX(5px);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.kanban-card.hot {
    border-left-color: var(--success);
}

.kanban-card.human {
    border-left-color: var(--danger);
}

.card-title {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-main);
    /* Mudado para variável */
    margin-bottom: 5px;
}

.card-desc {
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-bottom: 10px;
    line-height: 1.4;
}

.card-meta {
    font-size: 0.7rem;
    color: var(--text-dim);
    font-family: 'JetBrains Mono';
    display: flex;
    justify-content: space-between;
}


/* ==========================================
   7. ADS MANAGER (Anúncios)
   ========================================== */

.ads-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.ad-card {
    background: var(--bg-card);
    border: var(--border);
    padding: 20px;
    position: relative;
}

.ad-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--success);
    color: #000;
    padding: 2px 6px;
    font-size: 0.6rem;
    font-weight: bold;
    border-radius: 2px;
}


/* ==========================================
   8. RAIO-X INSTAGRAM
   ========================================== */

#ig-profile-widget {
    background: var(--bg-card);
    border: var(--border);
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 30px;
}

.ig-grid-layout {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 40px;
    align-items: center;
}

.ig-profile-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border-right: 1px solid rgba(150, 150, 150, 0.2);
    padding-right: 40px;
}

.ig-profile-main img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 3px solid var(--primary);
    object-fit: cover;
    box-shadow: 0 0 20px var(--primary-glow);
    margin-bottom: 15px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.stat-card {
    background: rgba(0, 0, 0, 0.1);
    padding: 20px;
    border-radius: 4px;
    text-align: center;
    border: 1px solid rgba(150, 150, 150, 0.2);
}

.stat-card h3 {
    font-family: 'JetBrains Mono';
    color: var(--text-main);
    /* Mudado para variável */
    font-size: 1.5rem;
}

.stat-card small {
    color: var(--primary);
    text-transform: uppercase;
    font-size: 0.6rem;
}

.ig-actions {
    margin-top: 30px;
    display: flex;
    gap: 10px;
}

.btn-sync {
    border-color: var(--success) !important;
    color: var(--success) !important;
}

.ig-feed-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    color: var(--primary);
}

#ig-posts-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}


/* ==========================================
   9. CONFIGURAÇÕES (Grelhas de Temas e Módulos)
   ========================================== */

.theme-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.config-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    width: 100%;
}


/* ==========================================
   10. CHAT LATERAL E BOTÃO FLUTUANTE (Modo Kodee)
   ========================================== */

.fab-chat {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: var(--primary);
    color: #000;
    border: none;
    border-radius: 50%;
    font-size: 26px;
    cursor: pointer;
    box-shadow: 0 4px 20px var(--primary-glow);
    z-index: 999;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fab-chat:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px var(--primary-glow);
}

.chat-sidebar {
    position: fixed;
    top: 0;
    right: -450px;
    width: 400px;
    max-width: 100vw;
    height: 100dvh;
    background: var(--bg-card);
    /* Ajustado para variável dinâmica */
    z-index: 1000;
    transition: right 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
    border-left: var(--border);
    display: flex;
    flex-direction: column;
}

.chat-sidebar.chat-open {
    right: 0;
}

.btn-fechar-chat {
    background: transparent;
    border: none;
    color: #888;
    font-size: 24px;
    cursor: pointer;
    transition: color 0.3s;
}

.btn-fechar-chat:hover {
    color: var(--primary);
}

.chat-header {
    padding: 25px;
    border-bottom: var(--border);
    background: var(--bg-dark);
    /* Mudado para variável */
}

.chat-log {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.msg {
    padding: 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    line-height: 1.4;
    overflow-wrap: break-word;
}

.msg-ai {
    background: rgba(150, 150, 150, 0.05);
    border-left: 2px solid var(--primary);
    color: var(--text-dim);
    font-family: 'JetBrains Mono';
}

.msg-user {
    background: rgba(0, 243, 255, 0.1);
    border: 1px solid rgba(0, 243, 255, 0.2);
    color: var(--text-main);
    align-self: flex-end;
    text-align: right;
    max-width: 90%;
}

.input-area {
    padding: 20px;
    border-top: var(--border);
    background: var(--bg-dark);
    /* Mudado para variável */
}

.cmd-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 45px;
}

.btn-mic,
.btn-send {
    width: 45px;
    height: 100%;
    border: var(--border);
    background: transparent;
    color: var(--text-dim);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
}

.btn-send {
    background: var(--primary);
    color: #000;
    border: none;
}

.cmd-input {
    flex: 1;
    height: 100%;
    background: rgba(0, 0, 0, 0.05);
    /* Transparência leve para pegar a cor do fundo */
    border: var(--border);
    color: var(--primary);
    padding: 0 15px;
    font-family: 'JetBrains Mono';
    outline: none;
}


/* ==========================================
   11. RESPONSIVIDADE (Tablets e Telemóveis)
   ========================================== */

@media (max-width: 900px) {
    .ig-grid-layout {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }

    .ig-profile-main {
        border-right: none !important;
        border-bottom: 1px solid rgba(150, 150, 150, 0.2);
        padding-right: 0 !important;
        padding-bottom: 30px;
        margin-bottom: 10px;
    }

    #ig-posts-container {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }

    .stat-card {
        padding: 10px 5px;
    }

    .stat-card h3 {
        font-size: 1.1rem;
    }
}

@media (max-width: 768px) {
    body {
        flex-direction: column;
    }

    .main-panel {
        padding: 15px;
        height: 100dvh;
    }

    .view-section {
        padding-bottom: 110px !important;
    }

    .sidebar {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 70px;
        flex-direction: row;
        justify-content: space-around;
        align-items: center;
        padding: 0;
        border-right: none;
        border-top: var(--border);
        z-index: 998;
        background: var(--bg-card);
        /* Ajustado para variável */
    }

    .logo-icon {
        display: none;
    }

    .nav-btn {
        margin-bottom: 0;
        width: 50px;
        height: 50px;
    }

    .nav-btn.active::after {
        right: auto;
        top: -12px;
        width: 100%;
        height: 3px;
        left: 0;
    }

    .top-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .page-title h1 {
        font-size: 1.5rem;
    }

    .date-display {
        text-align: left;
    }

    .kpi-grid,
    .tools-grid,
    .kanban-board,
    .ads-grid {
        grid-template-columns: 1fr !important;
        height: auto;
    }

    .kanban-board {
        gap: 15px;
    }

    .kanban-col {
        min-height: 400px;
    }

    #view-ads>div:last-child {
        grid-template-columns: 1fr !important;
    }

    #view-ads>div[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }

    .config-grid {
        grid-template-columns: 1fr;
    }

    #view-calendar>div:first-child {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 15px;
    }

    #calendar-block-form {
        padding: 15px !important;
        gap: 10px !important;
    }

    #calendar-block-form input {
        width: 100% !important;
    }

    .calendar-responsive-wrapper {
        margin: 0 -15px;
        padding: 0 15px 15px 15px;
    }

    .fab-chat {
        bottom: 90px;
        right: 20px;
    }

    .chat-sidebar {
        width: 100%;
        right: -100%;
    }

    .login-box {
        width: 90%;
        padding: 30px 20px;
    }

    /* Força os 4 cards de Engajamento a ficarem 2x2 no telemóvel */
    div[style*="grid-template-columns: repeat(4, 1fr)"] {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px !important;
    }

    /* Dá um respiro para o gráfico não ficar tão colado nos cards */
    .chart-container {
        height: 280px !important;
        padding: 15px !important;
        margin-top: 10px !important;
    }
}

/* ==========================================
   AJUSTES FINOS DO NOVO LAYOUT DO PERFIL (ESQUERDA)
   ========================================== */

/* Garante que os cards na coluna da esquerda ocupem a largura toda da coluna */
.ig-profile-main .stats-grid {
    width: 100%;
    margin-top: 20px;
}

/* Formata o card da Projeção e as caixas que foram movidas para a esquerda */
.ig-profile-main>div:not(.stats-grid) {
    width: 100%;
    margin-top: 15px;
    text-align: left;
    /* Garante que os números e textos do card fiquem alinhados à esquerda e não centralizados como a foto */
}

/* Ajusta o título dentro do card da Projeção para ficar centralizado e bonito */
.ig-profile-main>div h3 {
    text-align: center;
    margin-bottom: 15px;
}

@media (max-width: 480px) {
    .theme-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ==========================================
   12. ANIMAÇÃO DE DIGITAÇÃO DO CHAT (TYPING)
   ========================================== */
.typing-indicator {
    background: rgba(150, 150, 150, 0.05);
    border-left: 2px solid var(--primary);
    padding: 12px 18px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
    margin-bottom: 10px;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    background-color: var(--primary);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.typing-indicator span:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-indicator span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {

    0%,
    80%,
    100% {
        transform: scale(0);
        opacity: 0.3;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}


/* ==========================================
   13. BLINDAGEM DE CONTRASTE (WHITE THEME OVERRIDES)
   ========================================== */

/* Descola os cards do fundo com uma sombra e borda */
body.theme-light .kpi-card,
body.theme-light .tool-card,
body.theme-light .chart-container,
body.theme-light .stat-card,
body.theme-light .kanban-col,
body.theme-light .ad-card,
body.theme-light .config-grid>div,
body.theme-light #ig-profile-widget {
    background: #ffffff !important;
    box-shadow: 0px 4px 15px rgba(0, 0, 0, 0.06) !important;
    border: 1px solid #e2e8f0 !important;
}

/* Força TODOS os textos e números dentro dos cards principais a ficarem escuros */
body.theme-light .kpi-card *,
body.theme-light .stat-card *,
body.theme-light .radar-item * {
    color: var(--text-main) !important;
}

/* Kanban Cards no Tema Claro */
body.theme-light .kanban-card {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-left: 3px solid var(--primary) !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02) !important;
}

body.theme-light .kanban-card:hover {
    background: #f1f5f9 !important;
}

/* Configurações e Alertas */
body.theme-light .config-grid h3,
body.theme-light #view-ads strong {
    color: var(--text-main) !important;
}

body.theme-light .config-grid p,
body.theme-light #view-ads p {
    color: var(--text-dim) !important;
}

/* Inputs Gerais e Calendário */
body.theme-light #calendar-block-form div {
    color: var(--text-main) !important;
}

body.theme-light .stark-input {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: var(--text-main) !important;
}

body.theme-light .stark-input:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 10px var(--primary-dim) !important;
}

/* ==========================================
   14. MODAL DO CALENDÁRIO E MAPA DE CALOR
   ========================================== */

/* Fundo escuro e desfocado da janela */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    /* Efeito de vidro desfocado */
    display: none;
    /* Escondido por padrão */
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Mostra o modal suavemente */
.modal-overlay.active {
    display: flex;
    opacity: 1;
}

/* A janela flutuante em si */
.modal-content {
    background: var(--bg-card);
    border: var(--border);
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    /* Não deixa a janela sair da tela */
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
    /* Efeito de deslizar para cima */
}

/* Cabeçalho da janela */
.modal-header {
    padding: 20px;
    border-bottom: var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-dark);
    border-radius: 8px 8px 0 0;
}

/* Botão de Fechar o modal */
.btn-fechar-modal {
    background: transparent;
    border: none;
    color: var(--text-dim);
    font-size: 1.5rem;
    cursor: pointer;
    transition: 0.2s;
}

.btn-fechar-modal:hover {
    color: var(--danger);
}

/* Área onde os clientes vão aparecer */
.modal-body {
    padding: 20px;
    overflow-y: auto;
    /* Cria barra de rolagem só aqui dentro se tiver muitos clientes */
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Design do Card de Edição de cada cliente */
.lead-edit-card {
    background: rgba(150, 150, 150, 0.05);
    border: var(--border);
    padding: 15px;
    border-radius: 6px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 15px;
    align-items: center;
    border-left: 3px solid var(--primary);
}

.lead-edit-card h4 {
    color: var(--text-main);
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.lead-edit-card p {
    color: var(--text-dim);
    font-size: 0.75rem;
    line-height: 1.4;
}

.lead-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-hora-edit {
    background: var(--bg-dark);
    border: var(--border);
    color: var(--text-main);
    padding: 6px 10px;
    border-radius: 4px;
    font-family: 'JetBrains Mono';
    font-size: 0.8rem;
    outline: none;
}

.input-hora-edit:focus {
    border-color: var(--primary);
}

.btn-salvar-lead {
    background: rgba(0, 243, 255, 0.1);
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: 0.2s;
    font-size: 0.75rem;
    font-family: 'JetBrains Mono';
    font-weight: bold;
}

.btn-salvar-lead:hover {
    background: var(--primary);
    color: #000;
}

/* --- ETIQUETAS E EFEITOS DO CALENDÁRIO --- */

/* Transforma o quadradinho do dia num botão interativo */
.cal-day-interactive {
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    /* Corta o excesso para o dia não esticar */
}

.cal-day-interactive:hover {
    background: rgba(0, 243, 255, 0.08) !important;
    transform: scale(1.02);
    border-color: var(--primary) !important;
    z-index: 2;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Etiquetas coloridas dentro do calendário (Mapa de Calor) */
.cal-badge {
    display: block;
    padding: 3px 6px;
    border-radius: 3px;
    font-size: 0.65rem;
    font-weight: bold;
    margin-top: 5px;
    text-align: left;
    white-space: nowrap;
}

.badge-pendente {
    background: rgba(0, 243, 255, 0.1);
    color: var(--primary);
    border-left: 2px solid var(--primary);
}

.badge-concluido {
    background: rgba(0, 255, 157, 0.1);
    color: var(--success);
    border-left: 2px solid var(--success);
}