*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body{
    min-height:100vh;
    background: radial-gradient(circle at top, #1a1f2f 0%, #0f121b 55%, #07090f 100%);
    font-family:"Segoe UI",Tahoma,Geneva,Verdana,sans-serif;
    color:#f8fafc;
    display:grid;
    grid-template-columns: 280px 1fr;
    overflow: hidden;
}


.sidebar{
    background: linear-gradient(180deg, #111827 0%, #0f1419 100%);
    border-right: 1px solid rgba(148,163,184,.1);
    padding: 20px;
    display:flex;
    flex-direction:column;
    gap: 30px;
    height: 100vh;
    overflow-y:auto;
    box-shadow: 4px 0 15px rgba(0,0,0,.3);
}

.sidebar-header{
    padding: 20px 0;
    border-bottom: 1px solid rgba(148,163,184,.1);
}

.sidebar-logo{
    display:flex;
    align-items:center;
    gap: 12px;
    color: #e2e8f0;
    font-weight:800;
    font-size: 20px;
}

.sidebar-logo .logo-mark{
    width: 42px;
    height: 42px;
    display:flex;
    align-items:center;
    justify-content:center;
    background: rgba(96,165,250,.08);
    border: 1px solid rgba(96,165,250,.18);
    border-radius: 14px;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.04);
}

.sidebar-logo svg{
    width: 28px;
    height: 28px;
    display:block;
}

.sidebar-logo span:last-child{
    letter-spacing: .04em;
    font-size: 18px;
    color: #f8fafc; }

.sidebar-nav{
    display:flex;
    flex-direction:column;
    gap: 8px;
}

.nav-item{
    display:flex;
    align-items:center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 10px;
    text-decoration:none;
    color: #cbd5e1;
    transition: .3s;
    font-weight:600;
    cursor:pointer;
}

.nav-item:hover,
.nav-item.active{
    background: rgba(59,130,246,.15);
    color: #60a5fa;
    border-left: 3px solid #60a5fa;
    padding-left:13px;
}

.nav-icon{
    font-size: 18px;
}


.app-container{
    display:flex;
    flex-direction:column;
    height: 100vh;
    overflow: hidden;
}


.top-bar{
    background: rgba(15,23,42,.95);
    border-bottom: 1px solid rgba(148,163,184,.1);
    padding: 16px 30px;
    display:grid;
    grid-template-columns: 1fr 2fr 1fr;
    align-items:center;
    gap: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,.2);
}

.top-bar-left h1{
    font-size: 24px;
    color: #f8fafc;
    font-weight:700;
}

.top-bar-center{
    display:flex;
    justify-content:center;
}

.search-wrapper{
    width: 100%;
    max-width: 400px;
}

.search-input{
    width:100%;
    padding: 12px 18px !important;
    background: rgba(30,41,59,.8) !important;
    border: 1px solid rgba(148,163,184,.25) !important;
    border-radius: 10px !important;
    color: #e2e8f0 !important;
    font-size: 14px !important;
    transition: .3s;
}

.search-input:focus{
    background: rgba(30,41,59,1) !important;
    border-color: #60a5fa !important;
    box-shadow: 0 0 0 4px rgba(96,165,250,.15) !important;
}

.top-bar-right{
    display:flex;
    align-items:center;
    gap: 20px;
    justify-content:flex-end;
}

.btn-add-lead{
    padding: 10px 20px;
    background: linear-gradient(135deg, #2563eb, #0f172a);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: .3s;
    box-shadow: 0 4px 12px rgba(37,99,235,.3);
}

.btn-add-lead:hover{
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37,99,235,.4);
}

.profile-icon{
    width: 40px;
    height: 40px;
    background: rgba(96,165,250,.1);
    border: 1px solid rgba(96,165,250,.3);
    border-radius: 50%;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size: 20px;
    cursor:pointer;
    transition: .3s;
}

.profile-icon:hover{
    background: rgba(96,165,250,.2);
}


.main-content{
    flex: 1;
    overflow-y:auto;
    padding: 30px;
    display:flex;
    flex-direction:column;
    gap: 30px;
}


.stats-container{
    display:grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 10px;
}

.stat-card{
    background: rgba(15, 23, 42, 0.95);
    padding:25px;
    border-radius:15px;
    text-align:center;
    box-shadow:0 12px 35px rgba(0,0,0,.45);
    border:1px solid rgba(148,163,184,.14);
    transition: .3s;
    cursor: pointer;
}

.stat-card:hover{
    transform: translateY(-4px);
    box-shadow:0 16px 40px rgba(0,0,0,.5);
    border-color: rgba(96,165,250,.25);
}

.stat-card h3{
    color:#60a5fa;
    font-size:2rem;
    margin-bottom: 8px;
}

.stat-card p{
    color:#cbd5e1;
    font-size: 14px;
    font-weight:600;
}


.leads-section{
    background: rgba(15, 23, 42, .95);
    border-radius:20px;
    box-shadow:0 12px 35px rgba(0,0,0,.45);
    border: 1px solid rgba(148,163,184,.1);
    padding: 30px;
    flex: 1;
    overflow: hidden;
    display:flex;
    flex-direction:column;
}

.leads-header{
    margin-bottom: 20px;
}

.leads-header h2{
    color: #f8fafc;
    font-size: 20px;
    font-weight:700;
}


.modal{
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,.5);
    z-index: 1000;
    align-items:center;
    justify-content:center;
    animation: fadeIn .3s ease-out;
}

.modal.active{
    display:flex;
}

@keyframes fadeIn{
    from{
        opacity: 0;
    }
    to{
        opacity: 1;
    }
}

.modal-content{
    background: rgba(15, 23, 42, .98);
    border-radius:20px;
    box-shadow: 0 20px 60px rgba(0,0,0,.6);
    border: 1px solid rgba(96,165,250,.2);
    padding: 40px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y:auto;
    animation: slideUp .3s ease-out;
}

@keyframes slideUp{
    from{
        transform: translateY(50px);
        opacity: 0;
    }
    to{
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:30px;
    border-bottom: 1px solid rgba(148,163,184,.1);
    padding-bottom:20px;
}

.modal-header h2{
    color: #f8fafc;
    font-size:22px;
}

.modal-close{
    background:none;
    border:none;
    color:#cbd5e1;
    font-size:28px;
    cursor:pointer;
    transition: .3s;
}

.modal-close:hover{
    color:#60a5fa;
    transform: rotate(90deg);
}


.form-container{
    display:flex;
    flex-direction:column;
    gap: 20px;
}

.form-grid{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:20px;
}

.form-group{
    display:flex;
    flex-direction:column;
    gap: 8px;
}

.form-group.full{
    grid-column: 1 / -1;
}

label{
    margin-bottom:0px;
    font-size:14px;
    font-weight:600;
    color:#cbd5e1;
}

input,
select{
    width:100%;
    padding:12px 16px;
    min-height:48px;
    border:1px solid rgba(148,163,184,.25);
    border-radius:10px;
    font-size:15px;
    transition:.3s;
    background: rgba(15, 23, 42, .9);
    color:#e2e8f0;
    cursor:pointer;
    touch-action:manipulation;
}

input::placeholder{
    color: rgba(203, 213, 225, .5);
}

select{
    -webkit-appearance:none;
    -moz-appearance:none;
    appearance:none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23cbd5e1' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right:40px;
}

input:focus,
select:focus{
    outline:none;
    border-color:#60a5fa;
    box-shadow:0 0 0 4px rgba(96,165,250,.15);
}

.form-actions{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:15px;
    margin-top:10px;
}

.btn{
    width:100%;
    padding:12px;
    border:none;
    border-radius:10px;
    font-size:15px;
    font-weight:600;
    cursor:pointer;
    transition:.3s;
}

.btn-primary{
    background:linear-gradient(135deg,#2563eb,#0f172a);
    color:white;
    box-shadow:0 10px 20px rgba(59,130,246,.2);
}

.btn-primary:hover{
    transform:translateY(-2px);
    box-shadow:0 14px 28px rgba(59,130,246,.35);
}

.btn-secondary{
    background:rgba(148,163,184,.1);
    color:#cbd5e1;
    border:1px solid rgba(148,163,184,.25);
}

.btn-secondary:hover{
    background:rgba(148,163,184,.15);
}


.table-responsive{
    overflow-x:auto;
    -webkit-overflow-scrolling: touch;
    flex: 1;
}

.table-responsive table{
    min-width:720px;
}

.status{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    padding:6px 14px;
    border-radius:999px;
    font-size:12px;
    font-weight:700;
    background:rgba(148,163,184,.12);
    color:#e2e8f0;
    white-space:nowrap;
    line-height:1.2;
    max-width:200px;
}

.status.new{
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.25) 0%, rgba(16, 185, 129, 0.18) 100%);
    color:#f8fafc;
    border:1.5px solid #22c55e;
    font-weight:800;
    box-shadow:0 0 12px rgba(16, 185, 129, 0.28);
}

.status.contacted{
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.22) 0%, rgba(37, 99, 235, 0.18) 100%);
    color:#f8fafc;
    border:1.5px solid #3b82f6;
    font-weight:800;
    box-shadow:0 0 12px rgba(59, 130, 246, 0.28);
}

.status.qualified{
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.3) 0%, rgba(52, 211, 153, 0.18) 100%);
    color:#f8fafc;
    border:1.5px solid #22c55e;
    font-weight:800;
    box-shadow:0 0 12px rgba(34, 197, 94, 0.32);
}

.status.in-discussion{
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.3) 0%, rgba(168, 85, 247, 0.17) 100%);
    color:#f8fafc;
    border:1.5px solid #a855f7;
    font-weight:800;
    box-shadow:0 0 12px rgba(168, 85, 247, 0.28);
}

.status.proposal-sent{
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.28) 0%, rgba(251, 191, 36, 0.17) 100%);
    color:#f8fafc;
    border:1.5px solid #f59e0b;
    font-weight:800;
    box-shadow:0 0 12px rgba(245, 158, 11, 0.32);
}

.status.negotiation{
    background: linear-gradient(135deg, rgba(206, 52, 118, 0.3) 0%, rgba(244, 114, 182, 0.17) 100%);
    color:#f8fafc;
    border:1.5px solid #db2777;
    font-weight:800;
    box-shadow:0 0 12px rgba(236, 72, 153, 0.28);
}

.status.closed-won{
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.35) 0%, rgba(86, 180, 211, 0.15) 100%);
    color:#f8fafc;
    border:2px solid #16a34a;
    font-weight:900;
    box-shadow:0 0 15px rgba(34, 197, 94, 0.4);
}

.status.closed-lost{
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.3) 0%, rgba(248, 113, 113, 0.17) 100%);
    color:#f8fafc;
    border:2px solid #ef4444;
    font-weight:900;
    box-shadow:0 0 15px rgba(239, 68, 68, 0.35);
}

.status.on-hold{
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.28) 0%, rgba(249, 115, 22, 0.18) 100%);
    color:#f8fafc;
    border:1.5px solid #f59e0b;
    font-weight:800;
    box-shadow:0 0 12px rgba(245, 158, 11, 0.32);
}

.status.disqualified{
    background: linear-gradient(135deg, rgba(107, 114, 128, 0.28) 0%, rgba(156, 163, 175, 0.15) 100%);
    color:#f8fafc;
    border:1.5px solid #9ca3af;
    font-weight:800;
    box-shadow:0 0 12px rgba(156, 163, 175, 0.25);
}

 
table{
    width:100%;
    border-collapse:collapse;
    background:rgba(19,24,37,.75);
    color:#e2e8f0;
}

th{
    background:rgba(30, 41, 59, .95);
    color:#f8fafc;
    padding:15px;
    text-align:left;
    border-bottom:1px solid rgba(148,163,184,.15);
}

th:nth-child(1){width:15%;}
th:nth-child(2){width:30%;}
th:nth-child(3){width:25%;}
th:nth-child(4){width:15%;}
th:nth-child(5){width:15%;}

td{
    padding:15px;
    border-bottom:1px solid rgba(148,163,184,.12);
    color:#cbd5e1;
}

tbody tr:hover{
    background:rgba(148,163,184,.08);
}

.edit-btn,
.delete-btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-width:70px;
    padding:10px 14px;
    border-radius:10px;
    font-size:13px;
    font-weight:600;
    transition:.25s;
}

.edit-btn{
    background:rgba(56,189,248,.16);
    color:#7dd3fc;
    border:1px solid rgba(56,189,248,.35);
    margin-right:8px;
}

.edit-btn:hover{
    transform:translateY(-1px);
    background:rgba(56,189,248,.24);
}

.delete-btn{
    background:rgba(248,113,113,.16);
    color:#fda4af;
    border:1px solid rgba(248,113,113,.35);
}

.delete-btn:hover{
    transform:translateY(-1px);
    background:rgba(248,113,113,.24);
}


@media (max-width:1024px){
    .stats-container{
        grid-template-columns:repeat(2,1fr);
    }

    .top-bar{
        grid-template-columns:1fr 1fr;
        gap:20px;
    }

    .top-bar-right{
        grid-column:2;
    }
}

@media (max-width:768px){
    body{
        grid-template-columns:1fr;
    }

    .sidebar{
        display:none;
    }

    .top-bar{
        grid-template-columns:1fr;
        gap:12px;
        padding:12px 16px;
    }

    .top-bar-left,
    .top-bar-center,
    .top-bar-right{
        grid-column:1;
    }

    .top-bar-left h1{
        font-size:18px;
    }

    .main-content{
        padding:16px;
        gap:16px;
    }

    .stats-container{
        grid-template-columns:1fr;
        gap:12px;
    }

    .leads-section{
        padding:16px;
    }

    .form-grid{
        grid-template-columns:1fr;
    }

    .form-actions{
        grid-template-columns:1fr;
    }

    th,
    td{
        padding:12px;
        font-size:13px;
    }

    .edit-btn,
    .delete-btn{
        min-width:60px;
        padding:8px 10px;
        font-size:12px;
    }

    .status{
        padding:4px 8px;
        font-size:11px;
    }

    .modal-content{
        padding:24px;
        max-width:95%;
    }
}

@media (max-width:480px){
    .stats-container{
        grid-template-columns:1fr;
        gap:10px;
    }

    .stat-card{
        padding:15px;
    }

    .stat-card h3{
        font-size:1.6rem;
    }

    .top-bar-center{
        order:3;
    }

    .search-wrapper{
        max-width:100%;
    }

    .table-responsive{
        overflow-x:hidden;
    }

    .table-responsive table{
        min-width:auto;
        width:100%;
        border:0;
    }

    .table-responsive thead{
        display:none;
    }

    .table-responsive tr{
        display:block;
        background:rgba(15, 23, 42, .95);
        margin-bottom:16px;
        padding:14px 16px;
        border-radius:16px;
        border:1px solid rgba(148,163,184,.12);
    }

    .table-responsive td{
        display:flex;
        justify-content:space-between;
        align-items:center;
        padding:10px 0;
        border-bottom:1px solid rgba(148,163,184,.12);
    }

    .table-responsive td:last-child{
        border-bottom:0;
    }

    .table-responsive td::before{
        content: "";
        display:block;
        color:#94a3b8;
        font-size:12px;
        margin-bottom:6px;
        width:100%;
    }

    .table-responsive td:nth-child(1)::before{ content: "Name"; }
    .table-responsive td:nth-child(2)::before{ content: "Email"; }
    .table-responsive td:nth-child(3)::before{ content: "Company"; }
    .table-responsive td:nth-child(4)::before{ content: "Status"; }
    .table-responsive td:nth-child(5)::before{ content: "Action"; }

    .table-responsive td .status{
        white-space:nowrap;
    }

    .table-responsive td .edit-btn,
    .table-responsive td .delete-btn{
        min-width:0;
        padding:8px 10px;
    }

    th,
    td{
        padding:10px;
    }

    input,
    select,
    .btn{
        font-size:14px;
        padding:10px 12px;
    }

    .modal-content{
        padding:20px;
        width:95%;
    }

    .modal-header h2{
        font-size:18px;
    }
}
