<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="csrf-token" content="<?php echo e(csrf_token()); ?>">
<title><?php echo $__env->yieldContent('title','Leads CRM'); ?> – Royal IT Park Services</title>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
<style>
*{box-sizing:border-box;margin:0;padding:0}
body{font-family:'Inter',sans-serif;background:#f0f4fa;color:#1a2340;font-size:14px}
 /* WATERMARK */
body::after {
    content: '';
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(0deg);
    width: 400px;
    height: 400px;
    background: url('/assets/logo_r.svg') no-repeat center center;
    background-size: contain;
    opacity: 0.07;
    pointer-events: none;
    z-index: 9999;
}
button,select,input,textarea{font-family:'Inter',sans-serif}
.layout{display:flex;min-height:100vh}
/* SIDEBAR */
.sidebar{width:228px;background:#1a2340;position:fixed;top:0;left:0;height:100vh;display:flex;flex-direction:column;overflow-y:auto;z-index:100;box-shadow:2px 0 16px rgba(0,0,0,.18);transition:width .25s cubic-bezier(.4,0,.2,1)}
.sidebar.collapsed{width:56px}
.sidebar.collapsed .sb-title,.sidebar.collapsed .sb-sec,.sidebar.collapsed .sbl span,.sidebar.collapsed .sbl .cnt,.sidebar.collapsed .sb-kpis,.sidebar.collapsed .sb-nm,.sidebar.collapsed .sb-rl,.sidebar.collapsed .online,.sidebar.collapsed .sb-toggle-label{display:none}
.sidebar.collapsed .sbl{justify-content:center;padding:10px 0}
.sidebar.collapsed .sb-brand{justify-content:center;padding:12px 8px}
.sidebar::-webkit-scrollbar{width:3px}.sidebar::-webkit-scrollbar-thumb{background:rgba(255,255,255,.15)}
.sb-brand{padding:16px 14px 12px;border-bottom:1px solid rgba(255,255,255,.08);display:flex;align-items:center;gap:10px}
.sb-logo{width:34px;height:34px;background:#1a73e8;border-radius:9px;display:flex;align-items:center;justify-content:center;flex-shrink:0}
.sb-logo svg{width:16px;height:16px;fill:#fff}
.sb-title{font-size:12.5px;font-weight:700;color:#fff;line-height:1.2}
.sb-title small{display:block;font-size:9px;color:rgba(255,255,255,.4);font-weight:400}
.sb-kpis{display:grid;grid-template-columns:1fr 1fr 1fr;gap:4px;padding:10px 12px;border-bottom:1px solid rgba(255,255,255,.08)}
.kpi{background:rgba(255,255,255,.07);border-radius:8px;padding:8px 6px;text-align:center}
.kpi .v{font-size:20px;font-weight:800;color:#fff;line-height:1}
.kpi .l{font-size:9px;color:rgba(255,255,255,.4);margin-top:2px}
.sb-sec{padding:12px 14px 3px;font-size:9px;font-weight:700;letter-spacing:.1em;text-transform:uppercase;color:rgba(255,255,255,.28)}
.sbl{display:flex;align-items:center;gap:8px;padding:8px 10px;margin:1px 6px;border-radius:8px;color:rgba(255,255,255,.62);font-size:12.5px;cursor:pointer;border:none;background:transparent;width:calc(100% - 12px);text-align:left;transition:.14s;text-decoration:none}
.sbl svg{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}
.sbl:hover{background:rgba(255,255,255,.08);color:#fff}
.sbl.active{background:#1a73e8;color:#fff;font-weight:600}
.sbl .cnt{margin-left:auto;font-size:9px;font-weight:700;padding:2px 6px;border-radius:10px;min-width:18px;text-align:center;color:#fff;background:rgba(255,255,255,.2)}
.cnt-r{background:#ef4444!important}.cnt-a{background:#f59e0b!important}.cnt-g{background:#10b981!important}
.sb-divider{height:1px;background:rgba(255,255,255,.07);margin:6px 12px}
.sb-foot{padding:10px 12px;border-top:1px solid rgba(255,255,255,.08);margin-top:auto;display:flex;align-items:center;gap:8px}
.sb-av{width:28px;height:28px;border-radius:50%;background:#1a73e8;display:flex;align-items:center;justify-content:center;font-size:10px;font-weight:700;color:#fff;flex-shrink:0}
.sb-nm{font-size:11.5px;color:#fff;font-weight:600}
.sb-rl{font-size:9px;color:rgba(255,255,255,.4)}
.online{width:7px;height:7px;border-radius:50%;background:#10b981;margin-left:auto;border:1.5px solid #1a2340}
/* MAIN */
.main{margin-left:228px;flex:1;display:flex;flex-direction:column;transition:margin-left .25s cubic-bezier(.4,0,.2,1)}
.main.sb-collapsed{margin-left:56px}
.topbar{background:#fff;border-bottom:1px solid #e0e6f0;height:54px;padding:0 22px;display:flex;align-items:center;gap:10px;position:sticky;top:0;z-index:50;box-shadow:0 1px 4px rgba(0,0,0,.06)}
.tb-title{font-size:15px;font-weight:800;color:#1a2340;flex:1}
.tb-srch{display:flex;align-items:center;gap:7px;background:#f0f4fa;border:1.5px solid #e0e6f0;border-radius:22px;padding:7px 13px;width:230px}
.tb-srch svg{width:13px;height:13px;fill:none;stroke:#9aa5b4;stroke-width:2;stroke-linecap:round;flex-shrink:0}
.tb-srch input{border:none;background:none;outline:none;font-size:12.5px;color:#1a2340;width:100%}
.tb-icon{width:36px;height:36px;border-radius:9px;border:none;background:transparent;display:flex;align-items:center;justify-content:center;cursor:pointer;color:#687182;text-decoration:none}
.tb-icon:hover{background:#f0f4fa}
.tb-icon svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round}
.tb-av{width:34px;height:34px;border-radius:50%;background:#1a73e8;display:flex;align-items:center;justify-content:center;color:#fff;font-weight:700;font-size:11px}
.content{padding:20px 22px;flex:1}
/* PAGE HEADER */
.page-hd{display:flex;align-items:flex-start;justify-content:space-between;margin-bottom:18px;flex-wrap:wrap;gap:10px}
.page-hd h2{font-size:19px;font-weight:800;color:#1a2340}
.page-hd p{font-size:12px;color:#687182;margin-top:3px}
.page-hd-right{display:flex;gap:7px;flex-wrap:wrap}
/* BUTTONS */
.btn{display:inline-flex;align-items:center;gap:6px;padding:8px 16px;border-radius:9px;font-size:12.5px;font-weight:600;border:1.5px solid transparent;cursor:pointer;white-space:nowrap;text-decoration:none}
.btn svg{width:13px;height:13px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;flex-shrink:0}
.btn-pri{background:#1a73e8;color:#fff;border-color:#1a73e8}.btn-pri:hover{background:#1558c0}
.btn-out{background:#fff;color:#1a2340;border-color:#dde2ec}.btn-out:hover{border-color:#1a73e8;color:#1a73e8}
.btn-grn{background:#d1fae5;color:#065f46;border-color:#a7f3d0}
.btn-red{background:#fee2e2;color:#991b1b;border-color:#fecaca}
.btn-sm{padding:6px 12px;font-size:12px}
/* DASHBOARD BANNER */
.dash-banner{background:linear-gradient(135deg,#1a2340,#1a3a6e 60%,#1a73e8);border-radius:14px;padding:22px 26px;margin-bottom:18px;display:flex;align-items:center;justify-content:space-between;gap:16px;position:relative;overflow:hidden}
.dash-banner::before{content:'';position:absolute;right:-40px;top:-40px;width:180px;height:180px;background:rgba(255,255,255,.04);border-radius:50%}
.dw-text h3{font-size:17px;font-weight:800;color:#fff;margin-bottom:4px}
.dw-text p{font-size:12.5px;color:rgba(255,255,255,.65)}
.dw-acts{display:flex;gap:8px;flex-wrap:wrap;position:relative;z-index:1}
.dw-btn{display:inline-flex;align-items:center;gap:6px;padding:7px 14px;border-radius:8px;font-size:12px;font-weight:600;background:rgba(255,255,255,.15);color:#fff;border:1px solid rgba(255,255,255,.25);cursor:pointer;text-decoration:none}
.dw-btn svg{width:13px;height:13px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round}
/* METRIC CARDS */
.metrics{display:grid;grid-template-columns:repeat(5,1fr);gap:11px;margin-bottom:18px}
.mc{background:#fff;border-radius:12px;padding:15px 16px;box-shadow:0 1px 4px rgba(0,0,0,.07);border:1.5px solid #edf0f7;position:relative;overflow:hidden}
.mc .mc-ico{width:38px;height:38px;border-radius:10px;display:flex;align-items:center;justify-content:center;margin-bottom:10px}
.mc .mc-ico svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round}
.mc .mc-val{font-size:26px;font-weight:800;color:#1a2340;line-height:1}
.mc .mc-lbl{font-size:11.5px;color:#687182;margin-top:3px}
.mc .mc-tr{font-size:11px;margin-top:6px;font-weight:500}
.tr-up{color:#10b981}.tr-dn{color:#ef4444}.tr-ne{color:#9aa5b4}
/* TARGET */
.target-box{background:#fff;border-radius:12px;padding:16px 20px;margin-bottom:18px;box-shadow:0 1px 4px rgba(0,0,0,.07);border:1.5px solid #edf0f7}
.target-box h4{font-size:13px;font-weight:700;color:#1a2340;margin-bottom:10px}
.target-meta{display:flex;justify-content:space-between;font-size:12px;margin-bottom:8px;flex-wrap:wrap;gap:5px;color:#687182}
.t-track{height:12px;background:#f0f4fa;border-radius:8px;overflow:hidden;margin-bottom:6px}
.t-fill{height:100%;background:linear-gradient(90deg,#10b981,#059669);border-radius:8px;transition:width .6s}
.t-labels{display:flex;justify-content:space-between;font-size:11px;color:#9aa5b4}
/* PIPELINE */
.pipe-box{background:#fff;border-radius:12px;padding:16px 20px;margin-bottom:18px;box-shadow:0 1px 4px rgba(0,0,0,.07);border:1.5px solid #edf0f7}
.pipe-box h4{font-size:13px;font-weight:700;color:#1a2340;margin-bottom:14px}
.pipe-stages{display:grid;grid-template-columns:repeat(7,1fr);gap:6px}
.pipe-st{border-radius:10px;padding:10px 8px;text-align:center;border:1.5px solid transparent;transition:.15s}
.pipe-st .pn{font-size:22px;font-weight:800;line-height:1}
.pipe-st .pl{font-size:10px;font-weight:600;margin-top:2px}
.pipe-st .pa{font-size:10px;font-weight:700;margin-top:4px}
.pipe-st .pb{height:4px;border-radius:2px;margin-top:8px}
/* DASH BOTTOM */
.dash-bottom{display:grid;grid-template-columns:1.4fr 1fr;gap:14px;margin-bottom:18px}
.dash-card{background:#fff;border-radius:12px;box-shadow:0 1px 4px rgba(0,0,0,.07);border:1.5px solid #edf0f7;overflow:hidden}
.dc-hd{padding:13px 16px;border-bottom:1.5px solid #f0f4fa;display:flex;align-items:center;justify-content:space-between}
.dc-hd h4{font-size:13px;font-weight:700;color:#1a2340}
.dc-body{padding:14px 16px}
.rl-item{display:flex;align-items:center;gap:10px;padding:9px 0;border-bottom:1px solid #f5f7fb}
.rl-item:last-child{border-bottom:none}
.rl-av{width:32px;height:32px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:11px;font-weight:700;flex-shrink:0}
.rl-name{font-size:12.5px;font-weight:600;color:#1a2340}
.rl-co{font-size:11px;color:#9aa5b4}
.rl-bud{font-size:12px;font-weight:700;color:#1a2340}
.src-row{display:flex;align-items:center;gap:8px;margin-bottom:10px}
.src-lbl{font-size:12px;color:#687182;width:80px;flex-shrink:0}
.src-track{flex:1;height:8px;background:#f0f4fa;border-radius:5px;overflow:hidden;position:relative}
.src-fill{height:100%;border-radius:5px;background:#93c5fd}
.src-won{position:absolute;right:0;top:0;height:100%;background:#10b981;border-radius:0 5px 5px 0}
.src-val{font-size:11.5px;font-weight:600;color:#1a2340;width:55px;text-align:right;flex-shrink:0}
.act-item{display:flex;gap:9px;padding:8px 0;border-bottom:1px solid #f5f7fb}
.act-item:last-child{border-bottom:none}
.act-dot{width:8px;height:8px;border-radius:50%;margin-top:4px;flex-shrink:0}
.act-txt{font-size:12px;color:#1a2340;line-height:1.5}
.act-time{font-size:10.5px;color:#9aa5b4;margin-top:2px}
/* BADGES */
.badge{display:inline-flex;align-items:center;padding:3px 9px;border-radius:20px;font-size:10.5px;font-weight:600;white-space:nowrap}
.b-new{background:#dbeafe;color:#1e40af}.b-contacted{background:#ede9fe;color:#5b21b6}
.b-positive{background:#d1fae5;color:#065f46}.b-followup{background:#fef3c7;color:#92400e}
.b-negotiation{background:#ffedd5;color:#9a3412}.b-won{background:#dcfce7;color:#14532d}
.b-lost{background:#fee2e2;color:#991b1b}.b-website{background:#fef3c7;color:#92400e}
.b-whatsapp{background:#dcfce7;color:#14532d}.b-referral{background:#ffe4e6;color:#9f1239}
.b-call{background:#dbeafe;color:#1e40af}.b-email{background:#ede9fe;color:#5b21b6}
.b-hi{background:#fee2e2;color:#991b1b}.b-med{background:#fef3c7;color:#92400e}.b-lo{background:#d1fae5;color:#065f46}
/* FILTER BAR */
.filter-bar{background:#fff;border:1.5px solid #edf0f7;border-radius:11px;padding:10px 13px;margin-bottom:13px;display:flex;align-items:center;gap:8px;flex-wrap:wrap;box-shadow:0 1px 3px rgba(0,0,0,.05)}
.f-srch{display:flex;align-items:center;gap:7px;background:#f0f4fa;border:1.5px solid #e0e6f0;border-radius:8px;padding:7px 11px;flex:1;min-width:150px}
.f-srch svg{width:12px;height:12px;fill:none;stroke:#9aa5b4;stroke-width:2;stroke-linecap:round;flex-shrink:0}
.f-srch input{border:none;background:none;outline:none;font-size:12.5px;color:#1a2340;width:100%}
.filter-bar select{background:#f0f4fa;border:1.5px solid #e0e6f0;border-radius:8px;padding:7px 10px;font-size:12px;color:#1a2340;outline:none;cursor:pointer}
.filter-bar select:focus{border-color:#1a73e8}
/* TABLE */
.tbl-wrap{background:#fff;border:1.5px solid #edf0f7;border-radius:12px;box-shadow:0 1px 4px rgba(0,0,0,.07);overflow:hidden}
.tbl-hd{padding:12px 16px;border-bottom:1.5px solid #f0f4fa;display:flex;align-items:center;justify-content:space-between;background:#fafbff}
.tbl-hd h3{font-size:13px;font-weight:700;color:#1a2340}
table{width:100%;border-collapse:collapse}
th{padding:10px 13px;text-align:left;font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.06em;color:#9aa5b4;border-bottom:1.5px solid #f0f4fa;background:#fafbff;white-space:nowrap}
td{padding:11px 13px;font-size:12.5px;color:#1a2340;border-bottom:1px solid #f5f7fb;vertical-align:middle}
tr:last-child td{border-bottom:none}
tr:hover td{background:#fafbff}
.lead-av{width:34px;height:34px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:700;flex-shrink:0}
/* STAGE SELECT */
.ssel{border:none;border-radius:8px;padding:5px 26px 5px 9px;font-size:11.5px;font-weight:600;cursor:pointer;outline:none;color:#fff;appearance:none;-webkit-appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 6px center;background-size:11px;max-width:130px}
.s-new{background:#1e40af}.s-contacted{background:#5b21b6}.s-positive{background:#065f46}
.s-followup{background:#92400e}.s-negotiation{background:#9a3412}.s-won{background:#14532d}.s-lost{background:#991b1b}
.asel{border:1.5px solid #e0e6f0;border-radius:8px;padding:5px 9px;font-size:11.5px;color:#1a2340;background:#f0f4fa;outline:none;cursor:pointer;max-width:120px;font-weight:500}
.asel:hover,.asel:focus{border-color:#1a73e8;background:#fff}
.pri-wrap{display:flex;align-items:center;gap:5px}
.pri-dot{width:8px;height:8px;border-radius:50%;flex-shrink:0}
.act-btns{display:flex;gap:4px}
.ab{display:inline-flex;align-items:center;gap:3px;padding:5px 9px;border-radius:7px;font-size:11px;font-weight:600;border:1.5px solid;cursor:pointer;text-decoration:none}
.ab svg{width:11px;height:11px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round}
.ab-v{background:#e8f0fe;color:#1a73e8;border-color:#c5d8fc}.ab-v:hover{background:#1a73e8;color:#fff;border-color:#1a73e8}
.ab-e{background:#fef3c7;color:#92400e;border-color:#fde68a}.ab-e:hover{background:#f59e0b;color:#fff;border-color:#f59e0b}
.ab-d{background:#fee2e2;color:#991b1b;border-color:#fecaca}.ab-d:hover{background:#ef4444;color:#fff;border-color:#ef4444}
/* DRAWER */
.overlay{position:fixed;inset:0;background:rgba(15,23,42,.5);z-index:200;display:none}
.overlay.show{display:block}
.drawer{position:fixed;top:0;right:-580px;width:580px;height:100vh;background:#fff;z-index:201;display:flex;flex-direction:column;transition:right .28s ease;box-shadow:-8px 0 40px rgba(0,0,0,.18)}
.drawer.open{right:0}
.dr-hd{padding:16px 20px;border-bottom:1.5px solid #f0f4fa;display:flex;align-items:center;gap:12px;flex-shrink:0;background:#fafbff}
.dr-av{width:48px;height:48px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:16px;font-weight:800;flex-shrink:0}
.dr-name{font-size:16px;font-weight:800;color:#1a2340}
.dr-sub{font-size:12px;color:#687182;margin-top:3px;display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.dr-close{margin-left:auto;width:32px;height:32px;border-radius:9px;border:1.5px solid #e0e6f0;background:#f0f4fa;cursor:pointer;display:flex;align-items:center;justify-content:center;color:#687182;flex-shrink:0}
.dr-close:hover{background:#fee2e2;border-color:#fecaca;color:#991b1b}
.dr-close svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round}
.dr-tabs{display:flex;border-bottom:1.5px solid #f0f4fa;background:#fafbff;flex-shrink:0}
.dtab{padding:11px 18px;font-size:12.5px;color:#687182;cursor:pointer;border:none;background:transparent;border-bottom:2.5px solid transparent;font-weight:500}
.dtab.active{color:#1a73e8;border-bottom-color:#1a73e8;font-weight:700;background:#fff}
.dtab:hover:not(.active){color:#1a2340;background:#f0f4fa}
.dr-body{flex:1;overflow-y:auto;padding:18px 20px}
.dr-body::-webkit-scrollbar{width:4px}.dr-body::-webkit-scrollbar-thumb{background:#e0e6f0;border-radius:4px}
/* DRAWER INNER */
.ig{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-bottom:16px}
.ig-cell{background:#fafbff;border:1.5px solid #edf0f7;border-radius:10px;padding:11px 13px}
.ig-cell .lbl{font-size:9.5px;font-weight:700;text-transform:uppercase;letter-spacing:.06em;color:#9aa5b4;margin-bottom:4px}
.ig-cell .val{font-size:13px;font-weight:600;color:#1a2340}
.qa-row{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:16px;padding-bottom:16px;border-bottom:1.5px solid #f0f4fa}
.qa{display:inline-flex;align-items:center;gap:5px;padding:7px 13px;border-radius:9px;font-size:12px;font-weight:600;border:1.5px solid #e0e6f0;background:#fff;color:#1a2340;cursor:pointer}
.qa svg{width:13px;height:13px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round}
.qa:hover{background:#f0f4fa;border-color:#1a73e8;color:#1a73e8}
.qa-wa{border-color:#d1fae5;color:#065f46;background:#f0fdf4}.qa-wa:hover{background:#10b981;color:#fff;border-color:#10b981}
.qa-pri{background:#1a73e8;color:#fff;border-color:#1a73e8}.qa-pri:hover{background:#1558c0}
.qa-won{background:#d1fae5;color:#065f46;border-color:#a7f3d0}.qa-won:hover{background:#10b981;color:#fff}
.qa-lost{background:#fee2e2;color:#991b1b;border-color:#fecaca}.qa-lost:hover{background:#ef4444;color:#fff}
.qa-del{background:#fee2e2;color:#991b1b;border-color:#fecaca}
.upd-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-bottom:16px;padding-bottom:16px;border-bottom:1.5px solid #f0f4fa}
.fld label{display:block;font-size:9.5px;font-weight:700;text-transform:uppercase;letter-spacing:.06em;color:#9aa5b4;margin-bottom:5px}
.fld select,.fld input,.fld textarea{width:100%;border:1.5px solid #e0e6f0;border-radius:9px;padding:9px 11px;font-size:13px;color:#1a2340;background:#fafbff;outline:none;font-family:'Inter',sans-serif}
.fld select:focus,.fld input:focus,.fld textarea:focus{border-color:#1a73e8;background:#fff}
.fld textarea{resize:none;line-height:1.6;height:70px}
/* NOTES */
.note-item{background:#fafbff;border:1.5px solid #edf0f7;border-radius:10px;padding:12px 14px;margin-bottom:9px}
.note-hd{display:flex;align-items:center;gap:8px;margin-bottom:6px;flex-wrap:wrap}
.note-av{width:24px;height:24px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:9px;font-weight:700;color:#fff;flex-shrink:0}
.note-by{font-size:12px;font-weight:700;color:#1a2340}
.note-time{font-size:10.5px;color:#9aa5b4;margin-left:auto}
.note-text{font-size:12.5px;color:#687182;line-height:1.6}
.note-add{background:#f0f4fa;border:1.5px solid #e0e6f0;border-radius:10px;padding:14px}
.note-add h5{font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.06em;color:#9aa5b4;margin-bottom:10px}
.note-add select,.note-add textarea{width:100%;border:1.5px solid #e0e6f0;border-radius:8px;padding:8px 10px;font-size:12.5px;color:#1a2340;background:#fff;outline:none;font-family:'Inter',sans-serif;margin-bottom:8px}
.note-add textarea{height:76px;resize:none;line-height:1.5}
.note-add textarea:focus,.note-add select:focus{border-color:#1a73e8}
/* TIMELINE */
.tl-wrap{position:relative;padding-left:24px}
.tl-wrap::before{content:'';position:absolute;left:8px;top:6px;bottom:6px;width:2px;background:#e0e6f0}
.tl-item{position:relative;margin-bottom:14px}
.tl-dot{position:absolute;left:-19px;top:4px;width:10px;height:10px;border-radius:50%;border:2px solid #fff}
.tl-card{background:#fafbff;border:1.5px solid #edf0f7;border-radius:10px;padding:10px 13px}
.tl-title{font-size:12.5px;font-weight:700;color:#1a2340}
.tl-time{font-size:10.5px;color:#9aa5b4}
.tl-desc{font-size:12px;color:#687182;margin-top:3px;line-height:1.5}
/* FORMS */
.form-card{background:#fff;border:1.5px solid #edf0f7;border-radius:12px;padding:22px;box-shadow:0 1px 4px rgba(0,0,0,.07)}
.form-card h3{font-size:15px;font-weight:700;color:#1a2340;margin-bottom:18px}
.form-row{display:grid;gap:13px;margin-bottom:13px}
.fr2{grid-template-columns:1fr 1fr}.fr3{grid-template-columns:1fr 1fr 1fr}.fr1{grid-template-columns:1fr}
.field label{display:block;font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.06em;color:#9aa5b4;margin-bottom:5px}
.field input,.field select,.field textarea{width:100%;border:1.5px solid #e0e6f0;border-radius:9px;padding:9px 12px;font-size:13px;font-family:'Inter',sans-serif;color:#1a2340;background:#fafbff;outline:none}
.field input:focus,.field select:focus,.field textarea:focus{border-color:#1a73e8;background:#fff}
.field textarea{height:84px;resize:vertical;line-height:1.6}
.req{color:#ef4444;margin-left:2px}
/* STATS */
.st-grid{display:grid;grid-template-columns:1fr 1fr;gap:13px}
.st-card{background:#fff;border:1.5px solid #edf0f7;border-radius:12px;padding:16px 18px;box-shadow:0 1px 4px rgba(0,0,0,.07)}
.st-card h4{font-size:13px;font-weight:700;color:#1a2340;margin-bottom:14px}
/* EMPTY */
.empty{text-align:center;padding:44px 20px;color:#9aa5b4}
.empty svg{width:48px;height:48px;fill:none;stroke:#d1d8e8;stroke-width:1.5;stroke-linecap:round;margin:0 auto 14px;display:block}
.empty h4{font-size:14px;font-weight:600;margin-bottom:5px}
.fmsg{font-size:13px;font-weight:600;margin-top:10px;padding:10px 13px;border-radius:8px}
.fmsg-ok{background:#d1fae5;color:#065f46}.fmsg-err{background:#fee2e2;color:#991b1b}
/* FLASH */
.flash{padding:12px 18px;border-radius:10px;font-size:13px;font-weight:600;margin-bottom:14px;display:flex;align-items:center;gap:8px}
.flash-ok{background:#d1fae5;color:#065f46;border:1.5px solid #a7f3d0}
.flash-err{background:#fee2e2;color:#991b1b;border:1.5px solid #fecaca}
/* EMPLOYEE MODAL */
.emp-modal-bg{position:fixed;inset:0;background:rgba(15,23,42,.52);z-index:300;display:none;align-items:center;justify-content:center;backdrop-filter:blur(2px)}
.emp-modal-bg.show{display:flex}
.emp-modal{background:#fff;border-radius:16px;width:560px;max-width:95vw;max-height:90vh;overflow-y:auto;box-shadow:0 24px 60px rgba(0,0,0,.22)}
.em-hd{padding:16px 20px;border-bottom:1.5px solid #f0f4fa;display:flex;align-items:center;justify-content:space-between;position:sticky;top:0;background:#fff;z-index:1}
.em-hd h3{font-size:15px;font-weight:800;color:#1a2340}
.em-close{width:32px;height:32px;border-radius:8px;border:1.5px solid #e0e6f0;background:#f0f4fa;cursor:pointer;display:flex;align-items:center;justify-content:center;font-size:16px;color:#687182;line-height:1}
.em-close:hover{background:#fee2e2;color:#991b1b}
.em-body{padding:18px 20px}
.em-footer{padding:14px 20px;border-top:1.5px solid #f0f4fa;display:flex;gap:8px;justify-content:flex-end;background:#fafbff;position:sticky;bottom:0}
.em-row2{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-bottom:12px}
.em-row3{display:grid;grid-template-columns:1fr 1fr 1fr;gap:12px;margin-bottom:12px}
.em-field{margin-bottom:0}
.em-field label{display:block;font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.06em;color:#687182;margin-bottom:5px}
.em-field input,.em-field select,.em-field textarea{width:100%;border:1.5px solid #e0e6f0;border-radius:8px;padding:9px 11px;font-size:13px;color:#1a2340;background:#fafbff;outline:none;font-family:'Inter',sans-serif}
.em-field input:focus,.em-field select:focus,.em-field textarea:focus{border-color:#1a73e8;background:#fff}
.em-field textarea{resize:none;height:62px;line-height:1.5}
.av-colors{display:flex;gap:7px;flex-wrap:wrap;margin-top:4px}
.av-color{width:26px;height:26px;border-radius:50%;cursor:pointer;border:2.5px solid transparent;transition:.14s}
.av-color:hover,.av-color.sel{border-color:#fff;box-shadow:0 0 0 2px #1a73e8}
/* EMPLOYEE ACHIEVEMENT */
.emp-sum-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;padding:16px;border-bottom:1.5px solid #f0f4fa}
.emp-ach-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;padding:16px}
@media(max-width:900px){.emp-ach-grid{grid-template-columns:1fr 1fr}}
.emp-ach-card{background:#fff;border:1.5px solid #edf0f7;border-radius:12px;padding:14px 15px;box-shadow:0 1px 4px rgba(0,0,0,.06);position:relative}
.emp-chip-grid{display:grid;grid-template-columns:1fr 1fr 1fr;gap:6px;margin-bottom:10px}
/* MOBILE */
.mob-overlay{display:none;position:fixed;inset:0;background:rgba(0,0,0,.55);z-index:99;backdrop-filter:blur(2px)}
.mob-overlay.open{display:block}
.mob-fab{display:none;position:fixed;bottom:20px;right:20px;z-index:200;width:50px;height:50px;border-radius:50%;background:linear-gradient(135deg,#1a73e8,#059669);border:none;color:#fff;font-size:22px;cursor:pointer;box-shadow:0 4px 20px rgba(0,0,0,.28);align-items:center;justify-content:center;transition:.2s}
.mob-fab:hover{transform:scale(1.08)}
.mob-bottom-nav{display:none;position:fixed;bottom:0;left:0;right:0;background:#1a2340;z-index:180;border-top:1px solid rgba(255,255,255,.1);padding:6px 0 max(6px,env(safe-area-inset-bottom));justify-content:space-around;align-items:center}
.mbn-btn{display:flex;flex-direction:column;align-items:center;gap:2px;padding:5px 10px;cursor:pointer;color:rgba(255,255,255,.4);border:none;background:transparent;transition:.12s;border-radius:8px;font-family:inherit}
.mbn-btn.active,.mbn-btn:hover{color:#4ade80}
.mbn-btn svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.mbn-btn span{font-size:9.5px;font-weight:600}
.sb-toggle{display:none;width:34px;height:34px;background:rgba(255,255,255,.1);border:1px solid rgba(255,255,255,.2);border-radius:8px;color:#fff;cursor:pointer;align-items:center;justify-content:center;flex-shrink:0;transition:.15s}
.sb-toggle:hover{background:rgba(255,255,255,.18)}
.sb-toggle svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round}
/* RESPONSIVE */
@media(max-width:1100px){.metrics{grid-template-columns:repeat(3,1fr)}.pipe-stages{grid-template-columns:repeat(4,1fr)}.st-grid{grid-template-columns:1fr}}
@media(max-width:800px){.metrics{grid-template-columns:1fr 1fr}.fr2,.fr3{grid-template-columns:1fr}.dash-bottom{grid-template-columns:1fr}}
@media(max-width:640px){
  .sidebar{transform:translateX(-100%);transition:.28s cubic-bezier(.4,0,.2,1);width:240px!important;z-index:120}
  .sidebar.mob-open{transform:translateX(0)}
  .sidebar.collapsed{width:240px!important;transform:translateX(-100%)}
  .sidebar.collapsed.mob-open{transform:translateX(0)}
  .main{margin-left:0!important;transition:none!important}
  .topbar{padding:0 12px;position:sticky;top:0;z-index:90}
  .tb-srch{width:auto;flex:1}
  .tb-icon:not(:last-child){display:none}
  .content{padding:10px 12px 76px}
  .mob-bottom-nav{display:flex}
  .mob-fab{display:flex}
  .sb-toggle{display:flex}
  .metrics{grid-template-columns:1fr 1fr}
  .pipe-stages{grid-template-columns:repeat(4,1fr)}
  .dash-bottom{grid-template-columns:1fr}
  .fr2,.fr3{grid-template-columns:1fr}
  .st-grid{grid-template-columns:1fr}
  .drawer{width:100vw;right:-100vw}
  .emp-sum-grid{grid-template-columns:1fr 1fr}
  .emp-ach-grid{grid-template-columns:1fr}
}
/* EMPLOYEE ACHIEVEMENT — replace the old block with this */
.emp-sum-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:0px;padding:0px;border-bottom:1.5px solid #f0f4fa}
.emp-ach-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:0px;padding:0px}
.emp-ach-card{background:#fff;border:1.5px solid #edf0f7;border-radius:0px;padding:14px 15px;box-shadow:0 1px 4px rgba(0,0,0,.06);position:relative}
.emp-chip-grid{display:grid;grid-template-columns:1fr 1fr 1fr;gap:6px;margin-bottom:10px}
.emp-sum-box{padding:10px;text-align:center}
.emp-sum-icon{font-size:16px;margin-bottom:2px}
.emp-sum-val{font-size:15px;font-weight:800;line-height:1.2}
.emp-sum-lbl{font-size:10.5px;color:#9aabb8;text-transform:uppercase;letter-spacing:.04em;margin-top:2px}
.emp-chip{text-align:center;padding:6px 3px;border-radius:7px}
.emp-chip-v{font-size:15px;font-weight:800;line-height:1}
.emp-chip-l{font-size:9.5px;color:#9aabb8;text-transform:uppercase;letter-spacing:.03em;margin-top:2px}

@media(max-width:1300px){.emp-ach-grid{grid-template-columns:repeat(3,1fr)}}
@media(max-width:900px){.emp-ach-grid{grid-template-columns:1fr 1fr}.emp-sum-grid{grid-template-columns:1fr 1fr}}
@media(max-width:640px){.emp-ach-grid{grid-template-columns:1fr}.emp-sum-grid{grid-template-columns:1fr 1fr}}
</style>
</head>
<body>

<!-- MOBILE -->
<div class="mob-overlay" id="mob-overlay" onclick="closeMobSidebar()"></div>
<button class="mob-fab" id="mob-fab" onclick="toggleMobSidebar()" aria-label="Menu">
  <svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round">
    <line x1="3" y1="6" x2="21" y2="6"/><line x1="3" y1="12" x2="21" y2="12"/><line x1="3" y1="18" x2="21" y2="18"/>
  </svg>
</button>

<div class="layout">

<!-- ── SIDEBAR ── -->
<aside class="sidebar" id="sidebar">
  <div class="sb-brand" style="display:flex;align-items:center;justify-content:space-between">
    <div class="sb-logo">
      <svg viewBox="0 0 24 24"><polygon points="13 2 3 14 12 14 11 22 21 10 12 10 13 2"/></svg>
    </div>
    <div class="sb-title">Royal IT Park<small>Leads CRM</small></div>
    <button class="sb-toggle" onclick="toggleMobSidebar()" title="Close menu">
      <svg viewBox="0 0 24 24"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>
    </button>
  </div>

  <?php
  $allLeads = (isset($leads) && $leads instanceof \Illuminate\Support\Collection) ? $leads : \App\Models\Lead::all();
  $sbTotal = $allLeads->count();
  $sbWon   = $allLeads->where('stage','Won')->count();
  $sbAct   = $allLeads->whereNotIn('stage',['Won','Lost'])->count();
  $sbPos   = $allLeads->where('stage','Positive')->count();
  $sbFol   = $allLeads->where('stage','Follow Up')->count();
  $sbLost  = $allLeads->where('stage','Lost')->count();
  $sbEmp   = \App\Models\Employee::count();
?>

  <div class="sb-kpis">
    <div class="kpi"><div class="v"><?php echo e($sbTotal); ?></div><div class="l">Total</div></div>
    <div class="kpi"><div class="v"><?php echo e($sbWon); ?></div><div class="l">Won</div></div>
    <div class="kpi"><div class="v"><?php echo e($sbAct); ?></div><div class="l">Active</div></div>
  </div>

  <div class="sb-sec">Menu</div>
  <a href="<?php echo e(route('dashboard')); ?>" class="sbl <?php echo e(request()->routeIs('dashboard') ? 'active' : ''); ?>">
    <svg viewBox="0 0 24 24"><rect x="3" y="3" width="7" height="7"/><rect x="14" y="3" width="7" height="7"/><rect x="14" y="14" width="7" height="7"/><rect x="3" y="14" width="7" height="7"/></svg>
    <span>Dashboard</span>
  </a>
  <a href="<?php echo e(route('leads.index')); ?>" class="sbl <?php echo e(request()->routeIs('leads.index') ? 'active' : ''); ?>">
    <svg viewBox="0 0 24 24"><path d="M17 21v-2a4 4 0 00-4-4H5a4 4 0 00-4 4v2"/><circle cx="9" cy="7" r="4"/><path d="M23 21v-2a4 4 0 00-3-3.87"/><path d="M16 3.13a4 4 0 010 7.75"/></svg>
    <span>All Leads</span>
  </a>
  <a href="<?php echo e(route('leads.create')); ?>" class="sbl <?php echo e(request()->routeIs('leads.create','leads.edit') ? 'active' : ''); ?>">
    <svg viewBox="0 0 24 24"><line x1="12" y1="5" x2="12" y2="19"/><line x1="5" y1="12" x2="19" y2="12"/></svg>
    <span>Add Lead</span>
  </a>
  <a href="<?php echo e(route('statistics')); ?>" class="sbl <?php echo e(request()->routeIs('statistics') ? 'active' : ''); ?>">
    <svg viewBox="0 0 24 24"><line x1="18" y1="20" x2="18" y2="10"/><line x1="12" y1="20" x2="12" y2="4"/><line x1="6" y1="20" x2="6" y2="14"/></svg>
    <span>Statistics</span>
  </a>
  <div class="sb-divider"></div>

  <div class="sb-sec">Quick Filters</div>
  <a href="<?php echo e(route('leads.index',['stage'=>'Positive'])); ?>" class="sbl">
    <svg viewBox="0 0 24 24"><polyline points="20 6 9 17 4 12"/></svg>
    <span>Positive</span><span class="cnt cnt-g"><?php echo e($sbPos); ?></span>
  </a>
  <a class="sbl">
    <svg viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"/><polyline points="12 6 12 12 16 14"/></svg>
    <span>Follow Ups</span><span class="cnt cnt-a"><?php echo e($sbFol); ?></span>
  </a>
  <a class="sbl">
    <svg viewBox="0 0 24 24"><path d="M22 11.08V12a10 10 0 11-5.93-9.14"/><polyline points="22 4 12 14.01 9 11.01"/></svg>
    <span>Won Deals</span><span class="cnt cnt-g"><?php echo e($sbWon); ?></span>
  </a>
  <a class="sbl">
    <svg viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"/><line x1="15" y1="9" x2="9" y2="15"/><line x1="9" y1="9" x2="15" y2="15"/></svg>
    <span>Lost Leads</span><span class="cnt cnt-r"><?php echo e($sbLost); ?></span>
  </a>

  <div class="sb-sec">Team</div>
  <a href="<?php echo e(route('employees.index')); ?>" class="sbl <?php echo e(request()->routeIs('employees.*') ? 'active' : ''); ?>">
    <svg viewBox="0 0 24 24"><path d="M17 21v-2a4 4 0 00-4-4H5a4 4 0 00-4 4v2"/><circle cx="9" cy="7" r="4"/><path d="M23 21v-2a4 4 0 00-3-3.87M16 3.13a4 4 0 010 7.74"/></svg>
    <span>Employees</span><span class="cnt"><?php echo e($sbEmp); ?></span>
  </a>

  <div class="sb-foot">
    <div class="sb-av">AK</div>
    <div><div class="sb-nm">Admin Kumar</div><div class="sb-rl">Sales Manager</div></div>
    <div class="online"></div>
  </div>
</aside>

<!-- ── MAIN ── -->
<div class="main" id="main-wrap">
  <header class="topbar">
    <button onclick="toggleSidebar()" id="tb-ham" title="Toggle sidebar"
      style="width:34px;height:34px;background:none;border:1.5px solid #e0e6f0;border-radius:8px;cursor:pointer;display:flex;align-items:center;justify-content:center;flex-shrink:0;margin-right:4px;color:#4a5568;transition:.15s"
      onmouseover="this.style.borderColor='#1a73e8';this.style.color='#1a73e8'"
      onmouseout="this.style.borderColor='#e0e6f0';this.style.color='#4a5568'">
      <svg id="tb-ham-icon" width="17" height="17" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round">
        <line x1="3" y1="6" x2="21" y2="6"/><line x1="3" y1="12" x2="21" y2="12"/><line x1="3" y1="18" x2="21" y2="18"/>
      </svg>
    </button>
    <div class="tb-title"><?php echo $__env->yieldContent('page-title','Dashboard'); ?></div>
    <form action="<?php echo e(route('leads.index')); ?>" method="GET" style="display:contents">
      <div class="tb-srch">
        <svg viewBox="0 0 24 24"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/></svg>
        <input type="text" name="q" placeholder="Search leads..." value="<?php echo e(request('q')); ?>">
      </div>
    </form>
    <a href="<?php echo e(route('leads.export')); ?>" class="tb-icon" title="Export CSV">
      <svg viewBox="0 0 24 24"><path d="M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" y1="15" x2="12" y2="3"/></svg>
    </a>
    <button class="tb-icon"><svg viewBox="0 0 24 24"><path d="M18 8A6 6 0 006 8c0 7-3 9-3 9h18s-3-2-3-9"/><path d="M13.73 21a2 2 0 01-3.46 0"/></svg></button>
    <div class="tb-av">AK</div>
  </header>

  <div class="content">
    <?php if(session('success')): ?>
      <div class="flash flash-ok">✓ <?php echo e(session('success')); ?></div>
    <?php endif; ?>
    <?php if(session('error')): ?>
      <div class="flash flash-err">✕ <?php echo e(session('error')); ?></div>
    <?php endif; ?>
    <?php echo $__env->yieldContent('content'); ?>
  </div>
</div>

</div><!-- .layout -->

<!-- MOBILE BOTTOM NAV -->
<nav class="mob-bottom-nav">
  <a href="<?php echo e(route('dashboard')); ?>" class="mbn-btn <?php echo e(request()->routeIs('dashboard') ? 'active' : ''); ?>">
    <svg viewBox="0 0 24 24"><rect x="3" y="3" width="7" height="7"/><rect x="14" y="3" width="7" height="7"/><rect x="14" y="14" width="7" height="7"/><rect x="3" y="14" width="7" height="7"/></svg><span>Dashboard</span>
  </a>
  <a href="<?php echo e(route('leads.index')); ?>" class="mbn-btn <?php echo e(request()->routeIs('leads.index') ? 'active' : ''); ?>">
    <svg viewBox="0 0 24 24"><path d="M17 21v-2a4 4 0 00-4-4H5a4 4 0 00-4 4v2"/><circle cx="9" cy="7" r="4"/></svg><span>Leads</span>
  </a>
  <a href="<?php echo e(route('leads.create')); ?>" class="mbn-btn <?php echo e(request()->routeIs('leads.create') ? 'active' : ''); ?>">
    <svg viewBox="0 0 24 24"><line x1="12" y1="5" x2="12" y2="19"/><line x1="5" y1="12" x2="19" y2="12"/></svg><span>Add</span>
  </a>
  <a href="<?php echo e(route('employees.index')); ?>" class="mbn-btn <?php echo e(request()->routeIs('employees.*') ? 'active' : ''); ?>">
    <svg viewBox="0 0 24 24"><path d="M17 21v-2a4 4 0 00-4-4H5a4 4 0 00-4 4v2"/><circle cx="9" cy="7" r="4"/></svg><span>Team</span>
  </a>
  <a href="<?php echo e(route('statistics')); ?>" class="mbn-btn <?php echo e(request()->routeIs('statistics') ? 'active' : ''); ?>">
    <svg viewBox="0 0 24 24"><line x1="18" y1="20" x2="18" y2="10"/><line x1="12" y1="20" x2="12" y2="4"/><line x1="6" y1="20" x2="6" y2="14"/></svg><span>More</span>
  </a>
</nav>

<script>
var CSRF = document.querySelector('meta[name="csrf-token"]').getAttribute('content');

// Sidebar toggle (desktop)
// function toggleSidebar(){
//   var sb = document.getElementById('sidebar');
//   var mn = document.getElementById('main-wrap');
//   sb.classList.toggle('collapsed');
//   mn.classList.toggle('sb-collapsed');
// }
// Sidebar toggle (desktop) — swaps hamburger ↔ arrow icon based on collapsed state
function toggleSidebar(){
  var sb = document.getElementById('sidebar');
  var mn = document.getElementById('main-wrap');
  var icon = document.getElementById('tb-ham-icon');
  sb.classList.toggle('collapsed');
  mn.classList.toggle('sb-collapsed');

  if (sb.classList.contains('collapsed')) {
    // Show right-pointing arrow (expand action)
    icon.innerHTML = '<polyline points="9 18 15 12 9 6"/>';
  } else {
    // Show hamburger (collapse action)
    icon.innerHTML = '<line x1="3" y1="6" x2="21" y2="6"/><line x1="3" y1="12" x2="21" y2="12"/><line x1="3" y1="18" x2="21" y2="18"/>';
  }
}
// Mobile sidebar
function toggleMobSidebar(){
  document.getElementById('sidebar').classList.toggle('mob-open');
  document.getElementById('mob-overlay').classList.toggle('open');
}
function closeMobSidebar(){
  document.getElementById('sidebar').classList.remove('mob-open');
  document.getElementById('mob-overlay').classList.remove('open');
}
// Auto-hide flash after 4s
setTimeout(function(){var f=document.querySelector('.flash');if(f)f.style.display='none';},4000);
// AJAX helper
function ajaxPost(url,data,cb){
  fetch(url,{method:'POST',headers:{'Content-Type':'application/json','X-CSRF-TOKEN':CSRF,'Accept':'application/json'},body:JSON.stringify(data)})
  .then(function(r){return r.json();}).then(cb).catch(console.error);
}
<?php echo $__env->yieldPushContent('scripts-inline'); ?>
</script>
<?php echo $__env->yieldPushContent('scripts'); ?>
</body>
</html>
<?php /**PATH /home/royalitpark/public_html/leads_worksheet/resources/views/layouts/app.blade.php ENDPATH**/ ?>