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

:root {
    --primary: #5851ff; /* Modern Purple-Blue */
    --primary-dark: #3f38ca;
    --primary-light: #818cf8;
    --accent: #00d2ff;
    --secondary: #64748b;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --background: #f8fafc;
    --card-bg: rgba(255, 255, 255, 0.8);
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --radius: 16px;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.03);
    --shadow: 0 4px 12px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.03);
    --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.05);
    --glass: rgba(255, 255, 255, 0.75);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--background);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Premium Transparent Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(88, 81, 255, 0.15); /* Primary tint for brand consistency */
    border-radius: 10px;
    border: 1px solid transparent;
    background-clip: content-box;
    transition: all 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background-color: var(--primary);
}

.modal-body::-webkit-scrollbar {
    width: 5px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: rgba(88, 81, 255, 0.2);
    border-radius: 10px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
}

/* Auth Pages - Modern Split Layout */
.auth-page {
    min-height: 100vh;
    display: flex;
    background: #fff;
}

.auth-visual {
    flex: 1.2;
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 4rem;
    color: white;
}

.auth-visual h2 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    line-height: 1.1;
}

.auth-visual p {
    font-size: 1.25rem;
    opacity: 0.9;
    max-width: 500px;
}

.auth-form-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--background);
}

.auth-card-compact {
    background: var(--card-bg);
    padding: 3rem;
    border-radius: var(--radius);
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow-lg);
}

.auth-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--primary-dark);
}

.auth-logo i {
    background: var(--primary);
    color: white;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.form-control {
    width: 100%;
    padding: 0.6rem 0.875rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.875rem;
    transition: all 0.2s;
    background: #fff;
    color: var(--text-main);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Buttons */
.btn {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.8125rem;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

/* Layout Structure */
.wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.sidebar {
    width: 250px;
    background: #ffffff;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 1.25rem 0.75rem;
    position: sticky;
    top: 0;
    height: 100vh;
    flex-shrink: 0;
    z-index: 20;
    overflow-y: auto;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: #f1f5f9; /* Slightly darker background to make cards pop */
    overflow-y: auto;
    height: 100vh;
}

.header {
    background: white;
    height: 70px;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.content-body {
    padding: 1.25rem 1.5rem;
    flex: 1;
    max-width: 1600px;
    width: 100%;
    margin: 0 auto;
}

/* Nav Links */
.nav-link {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.75rem 0.875rem;
    color: var(--secondary);
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.8125rem;
    margin-bottom: 0.25rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
    opacity: 0.7;
}

.nav-link:hover {
    background: #f8fafc;
    color: var(--primary);
}

.nav-link.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(88, 81, 255, 0.25);
}

.nav-link.active i {
    opacity: 1;
}

.nav-link:active {
    transform: scale(0.98);
}

.nav-section-label {
    font-size: 0.6875rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.075em;
    padding: 1.5rem 1rem 0.75rem 1rem;
    opacity: 0.7;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.logout-link {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem 1rem;
    color: #ef4444;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.logout-link:hover {
    background: #fef2f2;
}

/* Base Components Refined */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    margin-bottom: 1rem;
    width: 100%;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--card-bg);
    padding: 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    height: 100%;
}

.stat-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.stat-info {
    min-width: 0;
}

.stat-info .value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1;
}

/* Tables Professional Layout */
.table-container {
    width: 100%;
    overflow-x: auto;
    border-radius: 0 0 var(--radius) var(--radius);
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th {
    padding: 0.75rem 1rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    background: #fcfcfd;
}

td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.8125rem;
    color: var(--text-main);
    vertical-align: middle;
}

tr:last-child td {
    border-bottom: none;
}

/* Status Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.badge-new {
    background: #e0f2fe;
    color: #0369a1;
}

.badge-followup {
    background: #fef3c7;
    color: #92400e;
}

.badge-interested {
    background: #e0e7ff;
    color: #4338ca;
}

.badge-converted {
    background: #d1fae5;
    color: #065f46;
}

.badge-lost {
    background: #fee2e2;
    color: #991b1b;
}

/* Glassmorphism Card (Elite) */
.dash-card {
    background: var(--glass);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.7);
    border-radius: 20px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.kpi-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.val-outfit {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
}

/* Scrollbar Hide */
.hide-scrollbar::-webkit-scrollbar { display: none; }
.hide-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* Elite Modal System */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    animation: fadeIn 0.4s ease;
}

.modal-card {
    background: white;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
}

.modal-card form {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.modal-header h3 {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    color: var(--text-main);
    margin: 0;
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 1.25rem 1.5rem;
    background: #f8fafc;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    flex-shrink: 0;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
}

/* Micro-animations */
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.animate-fadeIn { animation: fadeIn 0.4s ease forwards; }

.hover-glow:hover {
    box-shadow: 0 8px 30px rgba(88, 81, 255, 0.15);
    transform: translateY(-2px);
}

.hover-glow {
    transition: all 0.3s ease;
}