/* ═══════════════════════════════════════════
   ATLAS HOME — app.css
   Design system completo
═══════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&family=DM+Sans:wght@300;400;500;700&display=swap');

:root {
    --bg:       #08111f;
    --panel:    #0d1b2e;
    --surface:  #111f35;
    --card:     #162640;
    --deep:     #1c2f4a;

    --accent:   #00c8ff;
    --accent2:  #7b61ff;
    --green:    #00e5a0;
    --hot:      #ff4d4d;
    --warm:     #ff9a3c;
    --cold:     #3cb4ff;

    --text:     #e2eaf8;
    --muted:    #6b82a8;
    --border:   rgba(0, 200, 255, 0.10);

    --sidebar-w: 220px;
    --topbar-h:  54px;
    --radius:    12px;
    --radius-sm: 8px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { opacity: .85; }

/* ── Layout ── */
.layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ── Sidebar ── */
.sidebar {
    width: var(--sidebar-w);
    background: var(--panel);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow-y: auto;
}

.sidebar-logo {
    padding: 20px 18px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-logo .dot {
    width: 9px; height: 9px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 8px var(--green);
    flex-shrink: 0;
}

.sidebar-logo span {
    font-family: 'Space Mono', monospace;
    font-size: 13px;
    color: var(--accent);
    letter-spacing: -.3px;
}

.sidebar-section {
    padding: 14px 12px 6px;
    font-size: 10px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 18px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
    border-radius: 0;
    transition: background .15s, color .15s;
    cursor: pointer;
}

.nav-item:hover { background: rgba(0,200,255,.06); color: var(--text); }
.nav-item.active { background: rgba(0,200,255,.10); color: var(--accent); border-right: 2px solid var(--accent); }
.nav-item .icon { font-size: 16px; width: 20px; text-align: center; }

.sidebar-footer {
    margin-top: auto;
    padding: 14px 18px;
    border-top: 1px solid var(--border);
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: var(--surface);
    border-radius: var(--radius-sm);
}

.avatar {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: var(--accent2);
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700; color: white; flex-shrink: 0;
}

.user-chip p { font-size: 12px; font-weight: 600; }
.user-chip span { font-size: 10px; color: var(--muted); }

/* ── Main area ── */
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ── Topbar ── */
.topbar {
    height: var(--topbar-h);
    background: var(--panel);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 16px;
    flex-shrink: 0;
}

.topbar-title {
    font-family: 'Space Mono', monospace;
    font-size: 14px;
    color: var(--text);
}

.topbar-search {
    flex: 1;
    max-width: 340px;
    position: relative;
}

.topbar-search input {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 7px 16px;
    color: var(--text);
    font-size: 13px;
    outline: none;
}

.topbar-search input:focus { border-color: var(--accent); }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

/* ── Content ── */
.content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

/* ── KPI grid ── */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 24px;
}

.kpi-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
}

.kpi-card .label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .8px; margin-bottom: 8px; }
.kpi-card .value { font-family: 'Space Mono', monospace; font-size: 28px; font-weight: 700; color: var(--accent); }
.kpi-card .sub   { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* ── Cards ── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 18px;
}

.card-title {
    font-family: 'Space Mono', monospace;
    font-size: 12px;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: .8px;
    margin-bottom: 16px;
}

/* ── Tabla ── */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; padding: 8px 12px; border-bottom: 1px solid var(--border); }
.table td { padding: 11px 12px; border-bottom: 1px solid rgba(255,255,255,.04); font-size: 13px; }
.table tr:hover td { background: rgba(0,200,255,.03); }

/* ── Badges ── */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    font-family: 'Space Mono', monospace;
}

.badge-hot  { background: rgba(255,77,77,.15);  color: var(--hot); }
.badge-warm { background: rgba(255,154,60,.15); color: var(--warm); }
.badge-cold { background: rgba(60,180,255,.15); color: var(--cold); }
.badge-green{ background: rgba(0,229,160,.15);  color: var(--green); }
.badge-gray { background: rgba(107,130,168,.15);color: var(--muted); }

/* ── Formularios ── */
input, textarea, select {
    width: 100%;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    outline: none;
    margin-bottom: 10px;
    transition: border-color .2s;
}

input:focus, textarea:focus, select:focus { border-color: var(--accent); }
textarea { min-height: 80px; resize: vertical; }

/* ── Botones ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity .2s, transform .1s;
}

.btn:hover { opacity: .88; transform: translateY(-1px); }
.btn-primary  { background: var(--accent); color: #08111f; }
.btn-secondary{ background: var(--surface); border: 1px solid var(--border); color: var(--text); }
.btn-danger   { background: rgba(255,77,77,.15); border: 1px solid var(--hot); color: var(--hot); }
.btn-sm       { padding: 5px 12px; font-size: 12px; }

/* ── Neuro bar ── */
.neuro-bar { height: 4px; background: rgba(255,255,255,.08); border-radius: 4px; overflow: hidden; margin: 6px 0; }
.neuro-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--accent2), var(--accent)); }

/* ── Timeline ── */
.timeline-item {
    display: flex;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,.04);
}

.timeline-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-top: 5px; flex-shrink: 0; }
.timeline-item p { font-size: 12px; color: var(--muted); }
.timeline-item p b { color: var(--text); }

/* ── Kanban ── */
.kanban { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 10px; }
.kanban-col { min-width: 230px; width: 230px; background: var(--surface); border-radius: var(--radius); padding: 14px; flex-shrink: 0; }
.kanban-col-header { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.kanban-col-header h3 { font-size: 12px; font-weight: 700; }
.kanban-col-count { margin-left: auto; font-size: 11px; color: var(--muted); }
.kanban-card { background: var(--card); border-radius: 10px; padding: 12px; margin-bottom: 10px; border-left: 3px solid transparent; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* ── Responsive ── */
@media (max-width: 900px) {
    .sidebar { display: none; }
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ═══════════════════════════════════════════
   ATENEA — Badges y Cards Premium
   Paleta: #0F172A fondo · #D4A017 gold
═══════════════════════════════════════════ */

/* Badge de estado con borde dorado */
.badge-status {
    display: inline-flex;
    align-items: center;
    padding: 3px 12px;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border: 1px solid rgba(212, 160, 23, 0.35);
    color: #D4A017;
    background: rgba(212, 160, 23, 0.08);
}

.badge-status.alta  { border-color: rgba(34,197,94,.4);  color: #22C55E; background: rgba(34,197,94,.08);  }
.badge-status.media { border-color: rgba(249,115,22,.4); color: #F97316; background: rgba(249,115,22,.08); }
.badge-status.baja  { border-color: rgba(148,163,184,.3);color: #94A3B8; background: rgba(148,163,184,.06);}

/* Color de acento dorado */
.text-gold { color: #D4A017; }

/* Card ATENEA con glow dorado */
.bg-atenea-glow {
    background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
    box-shadow: 0 4px 20px rgba(212, 160, 23, 0.15), inset 0 0 0 1px rgba(212, 160, 23, 0.1);
    border-left: 3px solid #D4A017;
    border-radius: 10px;
    padding: 12px 14px;
}

/* Cards de leads carrito en dashboard */
.carrito-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.lead-carrito-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
    transition: border-color .2s, transform .15s;
    position: relative;
    overflow: hidden;
}

.lead-carrito-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, #D4A017, #E8C547, transparent);
}

.lead-carrito-card:hover {
    border-color: rgba(212, 160, 23, 0.4);
    transform: translateY(-2px);
}

.lead-carrito-card h4 {
    font-size: 13px;
    font-weight: 700;
    margin: 0 0 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lead-carrito-card .lead-email {
    font-size: 10px;
    color: var(--muted);
    margin-bottom: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.atenea-badge {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #D4A017;
    margin-bottom: 5px;
}

.prioridad-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.atenea-recomendacion {
    font-size: 11px;
    color: #CBD5E1;
    font-style: italic;
    line-height: 1.5;
    margin-bottom: 10px;
}

.cta-contactar {
    display: block;
    width: 100%;
    text-align: center;
    padding: 6px 0;
    background: linear-gradient(135deg, #D4A017, #E8C547);
    color: #0F172A;
    font-size: 10px;
    font-weight: 800;
    border-radius: 7px;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: .4px;
    transition: opacity .2s;
}

.cta-contactar:hover { opacity: .85; color: #0F172A; }