/* ==========================================================================
   AI Lead Scanner CRM — Dark / Neon Theme
   ========================================================================== */

#alscrm-app, .alscrm-modal, .alscrm-login-wall, .alscrm-toast {
    --alscrm-bg:        #0a0a0a;
    --alscrm-bg-panel:  #131313;
    --alscrm-bg-card:   #1a1a1a;
    --alscrm-bg-hover:  #202020;
    --alscrm-border:    #2b2b2b;
    --alscrm-text:      #f2f2f2;
    --alscrm-text-dim:  #a0a0a0;
    --alscrm-neon:      #39ff14;
    --alscrm-neon-dim:  #23a10c;
    --alscrm-neon-bg:   rgba(57, 255, 20, 0.08);
    --alscrm-red:       #ff4d4d;
    --alscrm-radius:    10px;
    --alscrm-font:      -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-family: var(--alscrm-font);
    box-sizing: border-box;
}

#alscrm-app *, .alscrm-modal *, .alscrm-login-wall *, .alscrm-toast * {
    box-sizing: border-box;
}

/* ---------- Root ---------- */
.alscrm-root {
    background: var(--alscrm-bg);
    color: var(--alscrm-text);
    border-radius: var(--alscrm-radius);
    padding: 20px;
    min-height: 70vh;
}

/* ---------- Login-Wall ---------- */
.alscrm-login-wall {
    background: var(--alscrm-bg);
    color: var(--alscrm-text);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    border-radius: var(--alscrm-radius);
}
.alscrm-login-box {
    max-width: 380px;
    width: 100%;
    text-align: center;
}
.alscrm-login-box h2 { color: var(--alscrm-neon); margin-bottom: 8px; }
.alscrm-login-box p { color: var(--alscrm-text-dim); margin-bottom: 20px; }
.alscrm-login-box input[type="text"],
.alscrm-login-box input[type="password"] {
    width: 100%;
    background: var(--alscrm-bg-card);
    border: 1px solid var(--alscrm-border);
    color: var(--alscrm-text);
    padding: 10px 12px;
    border-radius: 6px;
    margin-bottom: 12px;
}
.alscrm-login-box input[type="submit"] {
    width: 100%;
    background: var(--alscrm-neon);
    color: #06210a;
    font-weight: 700;
    border: none;
    padding: 10px 12px;
    border-radius: 6px;
    cursor: pointer;
}
.alscrm-login-box input[type="submit"]:hover { background: #4dff2e; }

/* ---------- Topbar ---------- */
.alscrm-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--alscrm-border);
}
.alscrm-brand {
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0.2px;
}
.alscrm-brand-accent { color: var(--alscrm-neon); }
.alscrm-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--alscrm-neon);
    box-shadow: 0 0 8px var(--alscrm-neon);
    display: inline-block;
}

.alscrm-view-toggle {
    display: flex;
    background: var(--alscrm-bg-card);
    border: 1px solid var(--alscrm-border);
    border-radius: 8px;
    padding: 3px;
}
.alscrm-toggle-btn {
    background: transparent;
    border: none;
    color: var(--alscrm-text-dim);
    padding: 6px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
}
.alscrm-toggle-btn.is-active {
    background: var(--alscrm-neon-bg);
    color: var(--alscrm-neon);
}

.alscrm-topbar-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.alscrm-user-badge { color: var(--alscrm-text-dim); font-size: 13px; margin-right: 4px; }

/* ---------- Buttons ---------- */
.alscrm-btn {
    border: 1px solid var(--alscrm-border);
    background: var(--alscrm-bg-card);
    color: var(--alscrm-text);
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.15s ease;
}
.alscrm-btn:hover { background: var(--alscrm-bg-hover); }
.alscrm-btn-primary {
    background: var(--alscrm-neon);
    color: #06210a;
    border-color: var(--alscrm-neon);
}
.alscrm-btn-primary:hover { background: #4dff2e; box-shadow: 0 0 12px rgba(57,255,20,0.4); }
.alscrm-btn-ghost { background: transparent; }
.alscrm-btn-danger { background: transparent; color: var(--alscrm-red); border-color: var(--alscrm-red); margin-right: auto; }
.alscrm-btn-danger:hover { background: rgba(255,77,77,0.1); }

/* ---------- Toolbar ---------- */
.alscrm-toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.alscrm-input, .alscrm-select {
    background: var(--alscrm-bg-card);
    border: 1px solid var(--alscrm-border);
    color: var(--alscrm-text);
    padding: 9px 12px;
    border-radius: 6px;
    font-size: 13px;
}
.alscrm-input { flex: 1; min-width: 220px; }
.alscrm-input:focus, .alscrm-select:focus { outline: 1px solid var(--alscrm-neon); }

/* ---------- Kanban ---------- */
.alscrm-kanban {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding-bottom: 10px;
}
.alscrm-column {
    background: var(--alscrm-bg-panel);
    border: 1px solid var(--alscrm-border);
    border-radius: var(--alscrm-radius);
    min-width: 260px;
    max-width: 260px;
    display: flex;
    flex-direction: column;
    max-height: 75vh;
}
.alscrm-column.is-dragover { border-color: var(--alscrm-neon); box-shadow: 0 0 0 1px var(--alscrm-neon) inset; }
.alscrm-column-header {
    padding: 12px 14px;
    font-weight: 700;
    font-size: 13px;
    border-bottom: 1px solid var(--alscrm-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.alscrm-column-count {
    background: var(--alscrm-bg-card);
    color: var(--alscrm-text-dim);
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
}
.alscrm-column-body { padding: 10px; overflow-y: auto; flex: 1; }

.alscrm-card {
    background: var(--alscrm-bg-card);
    border: 1px solid var(--alscrm-border);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    cursor: grab;
    transition: border-color 0.15s ease, transform 0.1s ease;
}
.alscrm-card:hover { border-color: var(--alscrm-neon-dim); transform: translateY(-1px); }
.alscrm-card.is-dragging { opacity: 0.4; }
.alscrm-card-name { font-weight: 700; font-size: 14px; margin-bottom: 2px; }
.alscrm-card-company { color: var(--alscrm-text-dim); font-size: 12px; margin-bottom: 8px; }
.alscrm-card-meta { display: flex; justify-content: space-between; align-items: center; font-size: 11px; }
.alscrm-badge {
    display: inline-block;
    background: var(--alscrm-neon-bg);
    color: var(--alscrm-neon);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}
.alscrm-card-followup { color: var(--alscrm-text-dim); }
.alscrm-card-followup.is-due { color: var(--alscrm-red); font-weight: 700; }

/* ---------- List / Table ---------- */
.alscrm-list { background: var(--alscrm-bg-panel); border: 1px solid var(--alscrm-border); border-radius: var(--alscrm-radius); overflow: auto; }
.alscrm-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.alscrm-table th {
    text-align: left;
    padding: 12px 14px;
    color: var(--alscrm-text-dim);
    border-bottom: 1px solid var(--alscrm-border);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
}
.alscrm-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--alscrm-border);
}
.alscrm-table tr:hover td { background: var(--alscrm-bg-hover); cursor: pointer; }
.alscrm-status-pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    background: var(--alscrm-neon-bg);
    color: var(--alscrm-neon);
}
.alscrm-row-delete {
    background: transparent;
    border: none;
    color: var(--alscrm-text-dim);
    cursor: pointer;
    font-size: 14px;
}
.alscrm-row-delete:hover { color: var(--alscrm-red); }

/* ---------- Modal ---------- */
.alscrm-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 99999;
    align-items: center;
    justify-content: center;
}
.alscrm-modal.is-open { display: flex; }
.alscrm-modal-box {
    background: var(--alscrm-bg-panel);
    border: 1px solid var(--alscrm-border);
    border-radius: var(--alscrm-radius);
    width: 100%;
    max-width: 640px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    color: var(--alscrm-text);
}
.alscrm-modal-small { max-width: 480px; }
.alscrm-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--alscrm-border);
}
.alscrm-modal-header h3 { margin: 0; color: var(--alscrm-neon); }
.alscrm-modal-close { background: none; border: none; color: var(--alscrm-text-dim); font-size: 22px; cursor: pointer; }
.alscrm-modal-body { padding: 20px; overflow-y: auto; }
.alscrm-modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 14px 20px;
    border-top: 1px solid var(--alscrm-border);
}

.alscrm-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.alscrm-field-wide { grid-column: 1 / -1; }
.alscrm-field label { display: block; font-size: 12px; color: var(--alscrm-text-dim); margin-bottom: 4px; }
.alscrm-field input, .alscrm-field select {
    width: 100%;
    background: var(--alscrm-bg-card);
    border: 1px solid var(--alscrm-border);
    color: var(--alscrm-text);
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 13px;
}
.alscrm-field input:focus, .alscrm-field select:focus { outline: 1px solid var(--alscrm-neon); }

.alscrm-notes-list { max-height: 180px; overflow-y: auto; margin: 14px 0; }
.alscrm-note-item {
    background: var(--alscrm-bg-card);
    border: 1px solid var(--alscrm-border);
    border-radius: 6px;
    padding: 8px 10px;
    margin-bottom: 8px;
    font-size: 13px;
}
.alscrm-note-meta { color: var(--alscrm-text-dim); font-size: 11px; margin-bottom: 4px; }
.alscrm-note-add { display: flex; gap: 8px; align-items: flex-start; }
.alscrm-note-add textarea {
    flex: 1;
    background: var(--alscrm-bg-card);
    border: 1px solid var(--alscrm-border);
    color: var(--alscrm-text);
    border-radius: 6px;
    padding: 8px;
    min-height: 44px;
    font-family: inherit;
}

.alscrm-hint { color: var(--alscrm-text-dim); font-size: 12px; }
.alscrm-hint code { color: var(--alscrm-neon); }

#alscrm-csv-file { color: var(--alscrm-text-dim); margin-bottom: 12px; }
#alscrm-import-preview table { width: 100%; font-size: 12px; border-collapse: collapse; }
#alscrm-import-preview th, #alscrm-import-preview td { border-bottom: 1px solid var(--alscrm-border); padding: 6px 8px; text-align: left; }

/* ---------- Toast ---------- */
.alscrm-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--alscrm-bg-card);
    border: 1px solid var(--alscrm-neon);
    color: var(--alscrm-text);
    padding: 12px 18px;
    border-radius: 8px;
    font-size: 13px;
    box-shadow: 0 0 16px rgba(57,255,20,0.25);
    display: none;
    z-index: 999999;
}
.alscrm-toast.is-error { border-color: var(--alscrm-red); box-shadow: 0 0 16px rgba(255,77,77,0.25); }
.alscrm-toast.is-visible { display: block; }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
    .alscrm-form-grid { grid-template-columns: 1fr; }
    .alscrm-topbar { flex-direction: column; align-items: flex-start; }
    .alscrm-table { font-size: 12px; }
}
