/* --- DESIGN SYSTEM v3.0 (Security Focus) --- */
:root {
    --primary: #6366f1;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --bg-dark: #0f172a;
    --glass: rgba(30, 41, 59, 0.7);
    --border: rgba(255, 255, 255, 0.1);
}

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

body {
    background: var(--bg-dark);
    background-image: radial-gradient(circle at 2px 2px, rgba(99, 102, 241, 0.15) 1px, transparent 0);
    background-size: 40px 40px;
    color: white;
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* SIDEBAR */
.sidebar {
    width: 280px;
    background: var(--glass);
    backdrop-filter: blur(12px);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 2rem 1.5rem;
}

.logo-container { display: flex; align-items: center; gap: 1rem; margin-bottom: 3rem; }

/* FORMS & INPUTS */
.form-card {
    background: var(--glass);
    padding: 2.5rem;
    border-radius: 20px;
    border: 1px solid var(--border);
}

.grid-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.form-group { display: flex; flex-direction: column; gap: 0.6rem; }
.form-group.span-2 { grid-column: span 2; }

label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

input, select, textarea {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    padding: 0.85rem 1rem;
    border-radius: 10px;
    color: white;
    font-size: 1rem;
    transition: all 0.3s ease;
    outline: none;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

input::placeholder { color: #475569; }

.logo-icon { color: var(--primary); width: 32px; height: 32px; }
.brand { font-size: 1.5rem; font-weight: 700; display: block; }
.version { font-size: 0.7rem; color: var(--primary); font-family: 'JetBrains Mono'; }

.nav-menu { display: flex; flex-direction: column; gap: 0.5rem; flex: 1; }
.nav-link {
    background: transparent;
    border: none;
    color: #94a3b8;
    padding: 0.8rem 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s;
}
.nav-link.active, .nav-link:hover { background: rgba(99, 102, 241, 0.1); color: white; }

/* AUTH BOX */
.admin-auth-box {
    background: rgba(0,0,0,0.2);
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid var(--border);
}
.auth-header { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8rem; margin-bottom: 0.5rem; color: var(--warning); }
#admin-key-input {
    width: 100%;
    background: #000;
    border: 1px solid var(--border);
    padding: 0.5rem;
    border-radius: 6px;
    color: var(--success);
    font-family: 'JetBrains Mono';
    outline: none;
}
.auth-tip { font-size: 0.65rem; color: #64748b; margin-top: 0.5rem; }

/* MAIN CONTENT */
.main-content { flex: 1; padding: 2rem 3rem; overflow-y: auto; }
.content-section { display: none; }
.content-section.active { display: block; animation: fadeIn 0.5s; }

.section-header { margin-bottom: 2.5rem; display: flex; justify-content: space-between; align-items: flex-start; }
h1 { font-size: 2rem; margin-bottom: 0.5rem; }

/* TABLE */
.table-container { background: var(--glass); border-radius: 16px; border: 1px solid var(--border); overflow: hidden; }
.leads-table { width: 100%; border-collapse: collapse; }
.leads-table th { background: rgba(0,0,0,0.2); padding: 1rem; text-align: left; font-size: 0.8rem; color: #94a3b8; text-transform: uppercase; }
.leads-table td { padding: 1.2rem 1rem; border-bottom: 1px solid var(--border); }

/* BADGES */
.status-badge {
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
}
.status-badge[data-status="Novo"] { background: rgba(99, 102, 241, 0.2); color: #818cf8; }
.status-badge[data-status="Em Contato"] { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.status-badge[data-status="Fechado"] { background: rgba(16, 185, 129, 0.2); color: #34d399; }

/* SECURITY LAB (SIDEBAR DIREITA) */
.api-lab {
    width: 320px;
    background: rgba(15, 23, 42, 0.9);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}
.lab-header { padding: 1.5rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 0.8rem; }
.security-status { padding: 0.8rem 1.5rem; font-size: 0.8rem; background: rgba(0,0,0,0.3); color: #94a3b8; display: flex; align-items: center; gap: 0.5rem; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #64748b; }
.status-dot.active { background: var(--warning); box-shadow: 0 0 10px var(--warning); }

.lab-output { flex: 1; padding: 1rem; overflow-y: auto; font-family: 'JetBrains Mono', monospace; font-size: 0.8rem; }
.log-entry { margin-bottom: 1rem; padding: 0.8rem; border-radius: 6px; background: rgba(255,255,255,0.03); border-left: 3px solid var(--primary); }
.log-entry.error { border-left-color: var(--danger); background: rgba(239, 68, 68, 0.05); }
.log-entry.response { border-left-color: var(--success); }

/* BUTTONS */
.btn-primary { background: var(--primary); color: white; border: none; padding: 0.8rem 1.5rem; border-radius: 8px; cursor: pointer; transition: 0.3s; }
.btn-primary:hover { opacity: 0.9; transform: translateY(-2px); }
.btn-action.delete { background: transparent; color: #64748b; border: none; cursor: pointer; }
.btn-action.delete:hover { color: var(--danger); }

/* TOAST */
.toast { position: fixed; bottom: 2rem; right: 2rem; padding: 1rem 2rem; border-radius: 12px; backdrop-filter: blur(10px); color: white; z-index: 1000; animation: slideUp 0.3s; }
.toast.success { background: rgba(16, 185, 129, 0.9); }
.toast.error { background: rgba(239, 68, 68, 0.9); }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }