/* Import Google Fonts - Premium Typography */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* Estilos globais premium - Tema Escuro Neon (Sem middlewares/libs) */
:root {
    --bg-dark: #0B0F19;
    --text-light: #F0F4F8;
    --text-muted: #8B98A5;
    --neon-cyan: #00E5FF;
    --neon-green: #00E676;
    --card-bg: rgba(26, 34, 53, 0.7);
    --column-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-light);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    /* Linhas de fundo premium simulando grid tecnológico */
    background-image: 
        linear-gradient(rgba(0, 229, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 229, 255, 0.03) 1px, transparent 1px);
    background-size: 30px 30px;
}

/* Custom Webkit Scrollbar elegante */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(0, 229, 255, 0.2);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 229, 255, 0.5);
}

.crm-header {
    padding: 24px;
    border-bottom: 1px solid var(--glass-border);
    text-align: center;
    background: linear-gradient(180deg, rgba(0,229,255,0.08) 0%, transparent 100%);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
    z-index: 10;
}

.crm-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-light);
    letter-spacing: 1px;
    text-shadow: 0 0 15px rgba(0, 229, 255, 0.4);
}

.crm-header p {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 400;
    margin-top: 8px;
}

.kanban-board {
    display: flex;
    gap: 25px;
    padding: 30px;
    overflow-x: auto;
    overflow-y: hidden;
    flex: 1;
    align-items: flex-start;
}

/* Base definitions for upcoming columns injecting via JS */
.kanban-column {
    background: var(--column-bg);
    border-radius: 12px;
    min-width: 320px;
    max-width: 320px;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 120px);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px); /* Glassmorphism key item */
    transition: all 0.3s ease;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.kanban-column h3 {
    padding: 18px;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--glass-border);
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kanban-column .count {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
}

/* Scrollable Container for Cards */
.kanban-cards {
    padding: 15px;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Leads Cards */
.lead-card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 16px;
    cursor: grab;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    position: relative;
    overflow: hidden;
}

/* Micro-interação: Linha Neon lateral */
.lead-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--neon-cyan);
    opacity: 0.4;
    transition: opacity 0.3s ease, box-shadow 0.3s ease;
}

.lead-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
    border-color: rgba(0, 229, 255, 0.3);
}

.lead-card:hover::before {
    opacity: 1;
    box-shadow: 0 0 10px var(--neon-cyan);
}

.lead-card:active {
    cursor: grabbing;
}

.card-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-light);
}

.card-desc {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.4;
    margin-bottom: 15px;
}

.card-tag {
    display: inline-block;
    background: rgba(0, 229, 255, 0.1);
    color: var(--neon-cyan);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wpp-quick-action {
    background: rgba(0, 230, 118, 0.1);
    color: var(--neon-green);
    font-size: 10px;
    padding: 4px 8px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
    border: 1px solid rgba(0, 230, 118, 0.3);
    white-space: nowrap;
}

.wpp-quick-action:hover {
    background: var(--neon-green);
    color: #000;
    box-shadow: 0 0 10px rgba(0, 230, 118, 0.4);
}

/* Drag and Drop Specific States */
.lead-card.dragging {
    opacity: 0.4;
    transform: scale(0.95);
}

.kanban-column.drag-over {
    background: rgba(0, 229, 255, 0.05);
    border-color: var(--neon-cyan);
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.1) inset;
}

/* ================================= */
/* Modal Estilos Premium (Fase 10) */
/* ================================= */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(11, 15, 25, 0.85); /* Fundo muito escuro */
    backdrop-filter: blur(10px); /* Traz o glassmorphism perfeito */
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--card-bg);
    border: 1px solid var(--neon-cyan);
    border-radius: 12px;
    width: 90%;
    max-width: 550px;
    padding: 30px;
    position: relative;
    box-shadow: 0 10px 50px rgba(0, 229, 255, 0.2);
    transform: translateY(30px);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    max-height: 90vh;
    overflow-y: auto;
}

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

.modal-close {
    position: absolute;
    top: 20px;
    right: 25px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 28px;
    cursor: pointer;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: #ff3366; /* Contraste vermelho ao fechar */
}

#modal-title {
    color: var(--neon-cyan);
    font-size: 22px;
    margin-bottom: 25px;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 15px;
}

.modal-info-group {
    margin-bottom: 18px;
}

.modal-info-group label {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 6px;
}

.modal-info-group p {
    font-size: 15px;
    color: var(--text-light);
    background: rgba(255, 255, 255, 0.03);
    padding: 12px 15px;
    border-radius: 6px;
    border-left: 3px solid var(--neon-cyan);
    line-height: 1.5;
}

/* ================================= */
/* Componentes UI Avançados (Fase 11) */
/* ================================= */
.modal-split {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 25px;
    border-top: 1px solid var(--glass-border);
    padding-top: 20px;
}
.modal-split h3 {
    color: var(--neon-cyan);
    font-size: 16px;
    margin-bottom: 5px;
}
.hist-list, .anexos-list {
    max-height: 180px;
    overflow-y: auto;
    margin-bottom: 10px;
    padding-right: 5px;
}
.hist-item {
    background: rgba(255, 255, 255, 0.02);
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 10px;
    border-left: 3px solid var(--neon-cyan);
    position: relative;
}
.hist-header {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding-bottom: 5px;
}
.hist-text { 
    font-size: 14px; 
    color: #fff; 
    line-height: 1.4;
    white-space: pre-wrap;
}
.anexo-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 229, 255, 0.05);
    padding: 10px 15px;
    border-radius: 6px;
    margin-bottom: 8px;
    border: 1px solid rgba(0, 229, 255, 0.1);
}
.anexo-item a { 
    color: var(--neon-cyan); 
    text-decoration: none; 
    font-size: 14px;
    font-weight: 500;
}
.anexo-item a:hover {
    text-decoration: underline;
}

/* Botões Nativos Superiores */
.btn-red { 
    background: rgba(255, 51, 102, 0.1); 
    color: #ff3366; 
    border: 1px solid #ff3366; 
    padding: 8px 15px; 
    border-radius: 4px; 
    cursor: pointer; 
    transition: all 0.2s;
    font-weight: bold;
    font-size: 12px;
}
.btn-red:hover {
    background: #ff3366;
    color: #fff;
    box-shadow: 0 0 10px rgba(255, 51, 102, 0.4);
}
.btn-blue { 
    background: rgba(0, 229, 255, 0.1); 
    color: var(--neon-cyan); 
    border: 1px solid var(--neon-cyan); 
    padding: 8px 15px; 
    border-radius: 4px; 
    cursor: pointer; 
    transition: all 0.2s;
    font-weight: bold;
    font-size: 12px;
}
.btn-blue:hover {
    background: var(--neon-cyan);
    color: #000;
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.4);
}
.btn-small { 
    padding: 5px; 
    border: none; 
    font-size: 12px; 
    cursor: pointer; 
    background: transparent; 
    color: var(--text-muted); 
    transition: 0.2s;
}
.btn-small:hover { color: #fff; transform: scale(1.1); }
.del-hist:hover, .del-anexo:hover { color: #ff3366; }

/* Inputs Nativos Internos */
.input-dark {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    color: #fff;
    padding: 10px;
    border-radius: 6px;
    width: 100%;
    margin-bottom: 10px;
    font-family: inherit;
}
.input-dark:focus {
    outline: none;
    border-color: var(--neon-cyan);
    box-shadow: 0 0 5px rgba(0, 229, 255, 0.2);
}
.action-grid {
    display: flex;
    flex-direction: column;
}
textarea.input-dark {
    resize: vertical;
    min-height: 80px;
}

/* ================================= */
/* Login Autenticação Segura (Fase 12) */
/* ================================= */
.login-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(11, 15, 25, 0.98); /* Totalmente opaco */
    backdrop-filter: blur(15px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease;
}
.login-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}
.login-box {
    background: var(--card-bg);
    border: 1px solid var(--neon-cyan);
    padding: 40px 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 0 50px rgba(0, 229, 255, 0.15);
    text-align: center;
}

