/* ===========================================
   MC Lead CRM – RADICAL Premium Redesign v2
   Knowhere-Style: Dramatic Edge Light + Glass
   =========================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

:root {
    --font: 'Inter', -apple-system, sans-serif;
    --bg: #030305;
    --bg-card: rgba(255, 255, 255, 0.02);
    --bg-input: rgba(255, 255, 255, 0.035);
    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);
    --text: #eaeaf0;
    --text-secondary: rgba(255, 255, 255, 0.5);
    --text-dim: rgba(255, 255, 255, 0.22);
    --green: #4ADE80;
    --green-soft: rgba(74, 222, 128, 0.1);
    --purple: #8B5CF6;
    --purple-soft: rgba(139, 92, 246, 0.1);
    --blue: #6366F1;
    --gold: #F59E0B;
    --gold-soft: rgba(245, 158, 11, 0.1);
    --orange: #F97316;
    --orange-soft: rgba(249, 115, 22, 0.1);
    --red: #EF4444;
    --red-soft: rgba(239, 68, 68, 0.08);
    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 6px;
    --t: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    position: relative;
}

/* =========================================
   DRAMATIC AMBIENT LIGHTING
   Like Knowhere – light beams from corners
   ========================================= */

/* Top-center spotlight – green tint */
body::before {
    content: '';
    position: fixed;
    top: -200px;
    left: 50%;
    transform: translateX(-50%);
    width: 900px;
    height: 600px;
    background: radial-gradient(ellipse at center, rgba(74, 222, 128, 0.07) 0%, rgba(74, 222, 128, 0.02) 40%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* Bottom-right purple glow */
body::after {
    content: '';
    position: fixed;
    bottom: -200px;
    right: -100px;
    width: 700px;
    height: 500px;
    background: radial-gradient(ellipse at center, rgba(139, 92, 246, 0.06) 0%, rgba(139, 92, 246, 0.02) 40%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* Edge light beams – left side */
.dashboard::before {
    content: '';
    position: fixed;
    top: 30%;
    left: -2px;
    width: 3px;
    height: 200px;
    background: linear-gradient(180deg, transparent, rgba(74, 222, 128, 0.25), rgba(139, 92, 246, 0.15), transparent);
    filter: blur(2px);
    pointer-events: none;
    z-index: 10;
}

/* Edge light beam – right side */
.dashboard::after {
    content: '';
    position: fixed;
    top: 15%;
    right: -2px;
    width: 3px;
    height: 250px;
    background: linear-gradient(180deg, transparent, rgba(139, 92, 246, 0.2), rgba(74, 222, 128, 0.12), transparent);
    filter: blur(2px);
    pointer-events: none;
    z-index: 10;
}

/* =========== LOGIN =========== */
.login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* Dramatic top spotlight for login */
.login-screen::before {
    content: '';
    position: absolute;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 400px;
    background: radial-gradient(ellipse at center, rgba(74, 222, 128, 0.08) 0%, transparent 60%);
    pointer-events: none;
}

/* Bottom purple for login */
.login-screen::after {
    content: '';
    position: absolute;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 300px;
    background: radial-gradient(ellipse at center, rgba(139, 92, 246, 0.05) 0%, transparent 60%);
    pointer-events: none;
}

.login-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 52px 44px;
    width: 100%;
    max-width: 380px;
    text-align: center;
    backdrop-filter: blur(40px);
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

/* Gradient border glow on the card – top edge shine */
.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 15%;
    right: 15%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(74, 222, 128, 0.4), rgba(139, 92, 246, 0.25), transparent);
}

/* Subtle inner gradient */
.login-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: linear-gradient(180deg, rgba(74, 222, 128, 0.02) 0%, transparent);
    pointer-events: none;
}

.login-logo {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--green), #22C55E);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 18px;
    color: #000;
    margin-bottom: 28px;
    box-shadow: 0 8px 40px rgba(74, 222, 128, 0.2), 0 0 60px rgba(74, 222, 128, 0.06);
    position: relative;
    z-index: 1;
}

.login-title {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 6px;
    position: relative;
    z-index: 1;
}

.login-subtitle {
    color: var(--text-dim);
    font-size: 13px;
    font-weight: 400;
    margin-bottom: 40px;
    letter-spacing: 0.3px;
    position: relative;
    z-index: 1;
}

.login-form { display: flex; flex-direction: column; gap: 12px; position: relative; z-index: 1; }

.login-input {
    width: 100%;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    outline: none;
    transition: var(--t);
    text-align: center;
    letter-spacing: 4px;
}

.login-input:focus {
    border-color: rgba(74, 222, 128, 0.35);
    box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.06), 0 0 30px rgba(74, 222, 128, 0.04);
    background: rgba(255, 255, 255, 0.06);
}

.login-btn {
    padding: 14px;
    background: linear-gradient(135deg, var(--green), #22C55E);
    border: none;
    border-radius: 12px;
    color: #000;
    font-family: var(--font);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: var(--t);
    letter-spacing: 0.2px;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 48px rgba(74, 222, 128, 0.25), 0 0 80px rgba(74, 222, 128, 0.08);
}

.login-error { color: var(--red); font-size: 12px; min-height: 18px; font-weight: 500; }

/* =========== DASHBOARD =========== */
.dashboard {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 32px 60px;
    position: relative;
    z-index: 1;
}

/* Top Bar */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 28px 0 24px;
    margin-bottom: 32px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.topbar__brand { display: flex; align-items: center; gap: 14px; }

.topbar__logo {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--green), #22C55E);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 13px;
    color: #000;
    box-shadow: 0 4px 20px rgba(74, 222, 128, 0.15);
}

.topbar__title {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.topbar__subtitle {
    font-size: 10px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 500;
}

.topbar__actions { display: flex; gap: 6px; }

.btn-refresh {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    font-size: 15px;
    cursor: pointer;
    transition: var(--t);
}

.btn-refresh:hover { background: rgba(255, 255, 255, 0.03); border-color: var(--border-hover); color: var(--green); }

.btn-logout {
    padding: 7px 14px;
    border-radius: 8px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-dim);
    font-family: var(--font);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--t);
}

.btn-logout:hover { border-color: rgba(239, 68, 68, 0.25); color: var(--red); }

/* =========== STATS ROW =========== */
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 28px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius);
    padding: 24px 26px;
    transition: var(--t);
    position: relative;
    overflow: hidden;
}

/* Top-edge gradient shine on each card */
.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20%;
    right: 20%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
    transition: var(--t);
}

.stat-card:hover { 
    border-color: rgba(255, 255, 255, 0.09);
    background: rgba(255, 255, 255, 0.025); 
}

.stat-card:hover::before {
    background: linear-gradient(90deg, transparent, rgba(74, 222, 128, 0.2), transparent);
    left: 10%;
    right: 10%;
}

.stat-card__value {
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -1.5px;
    margin-bottom: 6px;
    color: rgba(255, 255, 255, 0.85);
}

.stat-card--green .stat-card__value { color: var(--green); }
.stat-card--purple .stat-card__value { color: var(--purple); }
.stat-card--gold .stat-card__value { color: var(--gold); }

.stat-card__label {
    font-size: 10px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    font-weight: 500;
}

/* =========== CATEGORY BAR =========== */
.category-bar {
    display: flex;
    height: 3px;
    border-radius: 2px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.03);
    margin-bottom: 10px;
}

.category-bar__segment {
    background: var(--gold);
    transition: var(--t);
    min-width: 2px;
}

.category-bar__segment--qualified { background: var(--green); }
.category-bar__segment--premium { background: var(--purple); }
.category-bar__segment--whale { background: var(--orange); }
.category-bar__count { display: none; }

.category-legend {
    display: flex;
    gap: 20px;
    font-size: 10px;
    color: var(--text-dim);
    margin-bottom: 32px;
    font-weight: 400;
    letter-spacing: 0.3px;
}

/* =========== FILTERS =========== */
.filters {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.filter-group { display: flex; gap: 6px; flex-wrap: wrap; }

.filter-select, .filter-search {
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: 12px;
    font-weight: 400;
    outline: none;
    transition: var(--t);
}

.filter-select:focus, .filter-search:focus {
    border-color: rgba(74, 222, 128, 0.2);
    box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.04);
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
}

.filter-search { min-width: 220px; }

/* =========== TABLE =========== */
.table-wrapper {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
}

/* Gradient top-edge shine on table */
.table-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent);
    z-index: 1;
}

.leads-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.leads-table thead {
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.leads-table th {
    padding: 14px 20px;
    text-align: left;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-dim);
    font-weight: 600;
}

.th-sortable { cursor: pointer; user-select: none; }
.th-sortable:hover { color: var(--green); }

.leads-table td {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.025);
    vertical-align: middle;
}

.leads-table tbody tr {
    transition: var(--t);
    cursor: pointer;
}

.leads-table tbody tr:hover { background: rgba(74, 222, 128, 0.02); }
.leads-table tbody tr:last-child td { border-bottom: none; }

.empty-state { text-align: center; color: var(--text-dim); padding: 56px !important; font-size: 13px; }

/* =========== BADGES – Ultra Slim Pills =========== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    border: 1px solid transparent;
}

.badge--basic { background: var(--gold-soft); color: var(--gold); border-color: rgba(245, 158, 11, 0.12); }
.badge--qualified { background: var(--green-soft); color: var(--green); border-color: rgba(74, 222, 128, 0.12); }
.badge--premium { background: var(--purple-soft); color: var(--purple); border-color: rgba(139, 92, 246, 0.12); }
.badge--whale { background: var(--orange-soft); color: var(--orange); border-color: rgba(249, 115, 22, 0.12); }

.badge--new { background: rgba(99, 102, 241, 0.06); color: var(--blue); border-color: rgba(99, 102, 241, 0.1); }
.badge--contacted { background: var(--gold-soft); color: var(--gold); border-color: rgba(245, 158, 11, 0.1); }
.badge--won { background: var(--green-soft); color: var(--green); border-color: rgba(74, 222, 128, 0.1); }
.badge--lost { background: var(--red-soft); color: var(--red); border-color: rgba(239, 68, 68, 0.08); }

.badge--lg { padding: 5px 14px; font-size: 11px; }

.score-cell {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    font-size: 14px;
}

.lead-name { font-weight: 600; font-size: 13px; letter-spacing: -0.2px; }
.lead-company { font-size: 11px; color: var(--text-dim); }

.lead-count {
    padding: 10px 0;
    font-size: 10px;
    color: var(--text-dim);
    text-align: right;
    letter-spacing: 0.5px;
}

/* Empty State */
.empty-hero { text-align: center; padding: 80px 20px; }
.empty-hero__icon { font-size: 48px; margin-bottom: 20px; opacity: 0.7; }
.empty-hero h2 { font-size: 18px; font-weight: 600; margin-bottom: 8px; letter-spacing: -0.3px; }
.empty-hero p { color: var(--text-dim); font-size: 13px; line-height: 1.6; }
.empty-hero__url { margin-top: 16px; }
.empty-hero__url a { color: var(--green); text-decoration: none; font-weight: 500; }
.empty-hero__url a:hover { text-decoration: underline; }

/* =========== MODAL =========== */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(12px);
}

.modal__content {
    position: relative;
    background: #09090f;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 20px;
    width: 90%;
    max-width: 680px;
    max-height: 88vh;
    overflow-y: auto;
    padding: 40px;
    animation: fadeInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Gradient glow on top edge */
.modal__content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 8%;
    right: 8%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(74, 222, 128, 0.35), rgba(139, 92, 246, 0.2), transparent);
}

/* Inner top glow */
.modal__content::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(180deg, rgba(74, 222, 128, 0.015) 0%, transparent);
    pointer-events: none;
    border-radius: 20px 20px 0 0;
}

.modal__close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--text-dim);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: var(--t);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.modal__close:hover { border-color: rgba(239, 68, 68, 0.3); color: var(--red); }

.modal__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    position: relative;
    z-index: 1;
}

.modal__name { font-size: 24px; font-weight: 800; letter-spacing: -0.7px; }
.modal__company { color: var(--text-dim); font-size: 13px; margin-top: 4px; }

.modal__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    margin-bottom: 32px;
    position: relative;
    z-index: 1;
}

.modal__section h3 {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-dim);
    margin-bottom: 16px;
    font-weight: 600;
}

.detail-row {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 5px 0;
    font-size: 13px;
    color: var(--text-secondary);
}

.detail-row a { color: var(--green); text-decoration: none; font-weight: 500; }
.detail-row a:hover { text-decoration: underline; }

/* Score Display */
.score-display { text-align: center; padding: 12px 0; }

.score-display__number {
    font-size: 48px;
    font-weight: 900;
    letter-spacing: -3px;
    margin-bottom: 12px;
}

.score-display__bar {
    height: 3px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 10px;
}

.score-display__fill {
    height: 100%;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--green), var(--purple), var(--orange));
    transition: width 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.score-display__value { font-size: 11px; color: var(--text-dim); font-weight: 500; letter-spacing: 0.5px; }

/* Modal Actions */
.modal__actions {
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    padding-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
    z-index: 1;
}

.modal__status-group, .modal__notes-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.modal__status-group label, .modal__notes-group label {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-dim);
    font-weight: 600;
}

.modal__notes {
    width: 100%;
    min-height: 72px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    color: var(--text);
    font-family: var(--font);
    font-size: 13px;
    resize: vertical;
    outline: none;
    transition: var(--t);
    line-height: 1.6;
}

.modal__notes:focus {
    border-color: rgba(74, 222, 128, 0.2);
    box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.04);
}

.modal__quick-actions { display: flex; gap: 8px; }

.btn-action {
    flex: 1;
    padding: 12px;
    border-radius: 12px;
    text-align: center;
    text-decoration: none;
    font-family: var(--font);
    font-weight: 600;
    font-size: 13px;
    transition: var(--t);
}

.btn-action--call {
    background: rgba(74, 222, 128, 0.06);
    color: var(--green);
    border: 1px solid rgba(74, 222, 128, 0.1);
}

.btn-action--call:hover {
    background: rgba(74, 222, 128, 0.12);
    border-color: rgba(74, 222, 128, 0.2);
    box-shadow: 0 4px 20px rgba(74, 222, 128, 0.08);
}

.btn-action--email {
    background: rgba(99, 102, 241, 0.06);
    color: var(--blue);
    border: 1px solid rgba(99, 102, 241, 0.1);
}

.btn-action--email:hover {
    background: rgba(99, 102, 241, 0.12);
    border-color: rgba(99, 102, 241, 0.18);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.08);
}

/* Details Button in Table */
.btn-status-quick {
    padding: 5px 12px;
    border-radius: 100px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--text-dim);
    font-family: var(--font);
    font-size: 10px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--t);
    letter-spacing: 0.3px;
}

.btn-status-quick:hover {
    border-color: rgba(74, 222, 128, 0.25);
    color: var(--green);
    background: rgba(74, 222, 128, 0.04);
}

/* Animations */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Scrollbar */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.06); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.12); }

/* Selection */
::selection { background: rgba(74, 222, 128, 0.2); color: #fff; }

/* Responsive */
@media (max-width: 1024px) {
    .stats-row { grid-template-columns: repeat(2, 1fr); }
    .modal__grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .dashboard { padding: 0 16px 36px; }
    .stats-row { grid-template-columns: 1fr 1fr; gap: 8px; }
    .stat-card { padding: 18px; }
    .stat-card__value { font-size: 22px; }
    .filters { flex-direction: column; }
    .filter-search { min-width: auto; width: 100%; }
    .leads-table { font-size: 12px; }
    .leads-table th, .leads-table td { padding: 10px 12px; }
    .topbar { flex-direction: column; gap: 12px; align-items: flex-start; }
    .modal__content { padding: 24px; width: 96%; border-radius: 16px; }
    .modal__quick-actions { flex-direction: column; }
    .dashboard::before, .dashboard::after { display: none; }
}
