*{box-sizing:border-box}
:root{--primary:#5146e5;--primary2:#6d5df5;--bg:#f4f6fb;--card:#fff;--text:#111827;--muted:#64748b;--border:#e4e8f0}
html,body{margin:0;padding:0}body{font-family:Inter,ui-sans-serif,Arial,sans-serif;background:var(--bg);color:var(--text);font-size:14px}
.layout{display:flex;min-height:100vh}.sidebar{width:245px;background:linear-gradient(180deg,#0f172a,#111c33);color:#fff;padding:20px 13px;position:fixed;inset:0 auto 0 0;z-index:20;box-shadow:8px 0 35px rgba(15,23,42,.08)}
.brand{display:block;text-decoration:none;font-size:20px;font-weight:900;letter-spacing:.3px;padding:5px 10px 32px}.brand-white{color:#fff}.brand span:last-child{color:#818cf8}
.sidebar a:not(.brand){display:flex;align-items:center;gap:10px;color:#cbd5e1;text-decoration:none;padding:13px 13px;border-radius:11px;margin:5px 0;font-weight:700}.sidebar a:not(.brand):hover,.sidebar a.active{background:linear-gradient(90deg,rgba(99,102,241,.28),rgba(99,102,241,.12));color:#fff}
.sidebar .logout{margin-top:28px;color:#fca5a5}.content{margin-left:245px;padding:34px;width:calc(100% - 245px);max-width:1550px}
.top{display:flex;justify-content:space-between;align-items:center;gap:18px;margin-bottom:24px}.top h1{font-size:30px;line-height:1;margin:3px 0 8px;font-weight:900;letter-spacing:-.7px}.eyebrow{font-size:11px;letter-spacing:1.5px;font-weight:800;color:#6366f1}.muted{color:var(--muted);font-size:13px}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:7px;border:0;border-radius:11px;padding:11px 17px;background:linear-gradient(135deg,var(--primary),var(--primary2));color:#fff;text-decoration:none;cursor:pointer;font-weight:800;box-shadow:0 7px 16px rgba(81,70,229,.18);transition:.18s}.btn:hover{transform:translateY(-1px);box-shadow:0 10px 20px rgba(81,70,229,.22)}.btn.secondary{background:#eef0ff;color:#4338ca;box-shadow:none}.btn.danger{background:#fee2e2;color:#b91c1c;box-shadow:none}.btn.small{padding:8px 11px;font-size:12px}
.card-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:17px}.card{background:#fff;border:1px solid #e2e6ee;border-radius:17px;padding:21px;box-shadow:0 8px 28px rgba(15,23,42,.05)}
.stat-card{position:relative;overflow:hidden;min-height:172px}.stat-card:before{content:"";position:absolute;width:145px;height:145px;border-radius:50%;right:-62px;top:-62px;opacity:.8}.blue-card:before{background:#e9edff}.yellow-card:before{background:#fff5cc}.orange-card:before{background:#ffeddc}.green-card:before{background:#dcfce7}
.stat-top{display:flex;align-items:center;justify-content:space-between;position:relative;z-index:1}.stat-icon{width:46px;height:46px;border-radius:13px;display:flex;align-items:center;justify-content:center;font-size:21px;background:#eef2ff}.yellow-card .stat-icon{background:#fff7d6}.orange-card .stat-icon{background:#fff0e1}.green-card .stat-icon{background:#dcfce7}
.stat-mini{font-size:10px;font-weight:900;letter-spacing:1px;color:#94a3b8}.card-label{margin-top:17px}.number{font-size:38px;font-weight:900;margin-top:7px;letter-spacing:-1px}
.quick-card{margin-top:18px}.quick-card h3,.pending-card h3{margin:0 0 5px;font-size:18px}.quick-actions{display:flex;gap:11px;flex-wrap:wrap;margin-top:17px}
.followup-alert{display:flex;align-items:center;gap:14px;padding:15px 18px;margin:0 0 18px;background:linear-gradient(90deg,#fff7ed,#fffbeb);border:1px solid #fed7aa;border-radius:15px;color:#9a3412}.alert-icon{width:43px;height:43px;border-radius:12px;background:#ffedd5;display:flex;align-items:center;justify-content:center;font-size:20px}.alert-copy{flex:1;display:flex;flex-direction:column;gap:3px}.alert-copy strong{font-size:15px}.alert-copy span{font-size:12px;color:#b45309}.alert-link{color:#c2410c;text-decoration:none;font-weight:800;white-space:nowrap}
.pending-card{margin-top:18px}.section-heading{display:flex;align-items:center;justify-content:space-between;margin-bottom:13px}.pending-count{min-width:36px;height:36px;border-radius:11px;background:#fff7ed;color:#c2410c;display:flex;align-items:center;justify-content:center;font-weight:900}.pending-list{display:flex;flex-direction:column;gap:8px}.pending-item{display:flex;align-items:center;gap:12px;padding:13px;border:1px solid #edf0f5;border-radius:12px;text-decoration:none;color:#111827;background:#fafbfe}.pending-item:hover{background:#f7f6ff;border-color:#dcd7ff}.pending-avatar{width:38px;height:38px;border-radius:11px;background:#eef0ff;color:#4f46e5;display:flex;align-items:center;justify-content:center;font-weight:900}.pending-main{display:flex;flex-direction:column;gap:4px;flex:1}.pending-main span{font-size:12px;color:#64748b}.pending-date{font-size:12px;font-weight:800;color:#c2410c;white-space:nowrap}.pending-arrow{color:#818cf8;font-size:18px}
.filter-panel{background:#fff;border:1px solid #e3e7ef;border-radius:14px;padding:13px;margin-bottom:11px;box-shadow:0 5px 20px rgba(15,23,42,.035)}.search-form{display:flex;gap:9px;align-items:center;flex-wrap:wrap}.search-wrap{display:flex;align-items:center;gap:8px;border:1px solid #d7dce5;border-radius:10px;padding:0 11px;background:#fff;flex:1;min-width:250px}.search-input{border:0!important;outline:0!important;box-shadow:none!important;padding:11px 0!important;min-width:0;width:100%}.status-filter{padding:11px 12px;border:1px solid #d7dce5;border-radius:10px;background:#fff;font-family:inherit;color:#374151;min-width:145px}
.status-legend{display:flex;gap:14px;flex-wrap:wrap;margin:0 0 12px;padding:0 3px;color:#64748b;font-size:11px;font-weight:800}.dot{display:inline-block;width:8px;height:8px;border-radius:50%;margin-right:4px}.dot.blue{background:#6366f1}.dot.yellow{background:#eab308}.dot.green{background:#22c55e}.dot.red{background:#ef4444}
.table-wrap{background:#fff;border:1px solid #e1e6ef;border-radius:17px;padding:16px;overflow:auto;box-shadow:0 8px 28px rgba(15,23,42,.05)}.table{width:100%;border-collapse:separate;border-spacing:0}.table th{padding:12px 11px;border-bottom:1px solid #e2e8f0;text-align:left;white-space:nowrap;color:#64748b;font-size:11px;text-transform:uppercase;letter-spacing:.4px}.table td{padding:14px 11px;border-bottom:1px solid rgba(226,232,240,.8);white-space:nowrap}.table tbody tr:last-child td{border-bottom:0}
.lead-row.status-blue td{background:#f7f8ff}.lead-row.status-yellow td{background:#fffbea}.lead-row.status-green td{background:#f1fcf4}.lead-row.status-red td{background:#fff4f4}.lead-row.status-blue td:first-child{box-shadow:inset 4px 0 #6366f1}.lead-row.status-yellow td:first-child{box-shadow:inset 4px 0 #eab308}.lead-row.status-green td:first-child{box-shadow:inset 4px 0 #22c55e}.lead-row.status-red td:first-child{box-shadow:inset 4px 0 #ef4444}
.status-pill{display:inline-flex;align-items:center;gap:6px;padding:6px 10px;border-radius:999px;font-size:11px;font-weight:900}.status-pill.status-blue{background:#e7eaff;color:#4338ca}.status-pill.status-yellow{background:#fef3c7;color:#a16207}.status-pill.status-green{background:#dcfce7;color:#15803d}.status-pill.status-red{background:#fee2e2;color:#b91c1c}.pill-dot{width:7px;height:7px;border-radius:50%;background:currentColor}
.action-buttons{display:flex;gap:7px;align-items:center}.action-buttons form{margin:0}.empty{text-align:center!important;padding:35px!important;color:#64748b}
.form-card{max-width:820px;background:#fff;padding:26px;border-radius:16px;border:1px solid #e2e6ee;box-shadow:0 8px 28px rgba(15,23,42,.05)}.row{display:grid;grid-template-columns:1fr 1fr;gap:17px}.field{margin-bottom:17px}.field label{display:block;font-size:13px;font-weight:800;margin-bottom:8px;color:#374151}.field input,.field select,.field textarea{width:100%;padding:12px 13px;border:1px solid #d7dce5;border-radius:10px;font-size:14px;background:#fff;outline:none;font-family:inherit}.field textarea{min-height:110px;resize:vertical}.field input:focus,.field select:focus,.field textarea:focus{border-color:#818cf8;box-shadow:0 0 0 3px rgba(99,102,241,.12)}
.alert{padding:13px 15px;border-radius:10px;background:#fee2e2;color:#991b1b;margin-bottom:16px}.success{padding:13px 15px;border-radius:10px;background:#dcfce7;color:#166534;margin-bottom:16px}

@media(max-width:1050px){.card-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:800px){.sidebar{position:sticky;top:0;inset:auto;width:100%;height:auto;padding:8px 9px;display:flex;align-items:center;gap:3px;overflow-x:auto}.brand{padding:7px 8px;margin-right:auto;white-space:nowrap;font-size:16px}.sidebar a:not(.brand){padding:9px 9px;margin:0;white-space:nowrap;font-size:12px}.sidebar .logout{margin-top:0}.layout{display:block}.content{margin-left:0;width:100%;padding:20px 14px}.top h1{font-size:26px}}
@media(max-width:600px){.card-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:11px}.card{padding:15px;border-radius:14px}.stat-card{min-height:145px}.stat-icon{width:38px;height:38px;font-size:18px}.stat-mini{font-size:8px}.number{font-size:30px}.card-label{font-size:12px}.top{flex-direction:column;align-items:stretch}.top .btn{width:100%}.row{grid-template-columns:1fr}.form-card{padding:19px}.followup-alert{align-items:flex-start}.alert-link{display:none}.pending-item{align-items:flex-start}.pending-date{margin-left:50px}.pending-arrow{display:none}.search-form{display:grid;grid-template-columns:1fr 1fr}.search-wrap{grid-column:1/-1;min-width:0}.search-form .btn{width:100%}.status-filter{width:100%;min-width:0}.action-buttons{flex-direction:column;align-items:stretch}.action-buttons .btn{width:100%}.table th,.table td{padding:12px 8px}}

/* Clickable dashboard statistic cards */
.stat-link{display:block;text-decoration:none;color:inherit;cursor:pointer;transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease}
.stat-link:hover{transform:translateY(-4px);box-shadow:0 16px 34px rgba(15,23,42,.11);border-color:#cfd5e2}
.stat-link:active{transform:translateY(-1px)}
.card-link-hint{position:absolute;left:21px;bottom:17px;font-size:11px;font-weight:800;color:#64748b;opacity:.9}
.stat-link:hover .card-link-hint{color:#5146e5}

/* V5: fix clickable stat-card content overlap */
.stat-link{
    position:relative;
    min-height:172px;
    padding-bottom:20px;
}
.stat-link .number{
    position:relative;
    z-index:2;
    line-height:1.05;
    margin-bottom:0;
}
.stat-link .card-link-hint{
    position:relative;
    left:auto;
    bottom:auto;
    display:block;
    margin-top:9px;
    line-height:1.2;
    font-size:10px;
    z-index:2;
}
.stat-link:hover .card-link-hint{color:#5146e5}

@media(max-width:600px){
    .stat-link{
        min-height:158px;
        padding:15px;
    }
    .stat-link .card-label{margin-top:13px}
    .stat-link .number{
        font-size:30px;
        margin-top:6px;
    }
    .stat-link .card-link-hint{
        margin-top:8px;
        font-size:10px;
        white-space:nowrap;
    }
}

/* V8 navigation reliability */
a.btn,a.stat-link,a.pending-item,.sidebar a{cursor:pointer}
button.btn{cursor:pointer;border:0;font-family:inherit}
.sidebar .brand{cursor:pointer}
