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

:root {
    --primary: #7b5ef0;
    --primary-hover: #6747d9;
    --bg-color: #f4f7fe;
    --surface: #ffffff;
    --text-main: #2b3674;
    --text-muted: #a3aed1;
    --border: #f0f0f5;
    --shadow-sm: 0px 2px 4px rgba(112, 144, 176, 0.08);
    --shadow-md: 0px 10px 20px rgba(112, 144, 176, 0.12);
    --shadow-lg: 0px 20px 40px rgba(112, 144, 176, 0.2);
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --sidebar-width: 260px;
    --sidebar-min: 80px;

    /* Metric Colors */
    --hot: #ff5b5b;
    --warm: #f69927;
    --cold: #00b9e4;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background: var(--bg-color);
    color: var(--text-main);
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

img {
    max-width: 100%;
    height: auto;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text-main);
    font-weight: 700;
    line-height: 1.2;
}

.text-muted {
    color: var(--text-muted);
}

.text-sm {
    font-size: 13px;
}

.text-bold {
    font-weight: 700;
}

/* Utility */
.mb-1 {
    margin-bottom: 0.5rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

.mb-3 {
    margin-bottom: 1.5rem;
}

.mb-4 {
    margin-bottom: 2rem;
}

.flex {
    display: flex;
}

.flex-col {
    display: flex;
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.w-full {
    width: 100%;
}

.h-screen {
    height: 100vh;
}

.badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* --- LOGIN PAGE --- */
.login-wrapper {
    display: flex;
    height: 100vh;
    background: var(--bg-color);
}

.login-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px;
    background: linear-gradient(135deg, rgba(244, 247, 254, 1) 0%, rgba(255, 255, 255, 1) 100%);
}

.login-right {
    flex: 1;
    background: var(--primary);
    background: linear-gradient(135deg, #7b5ef0 0%, #3e1ab5 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.login-right::before {
    content: "";
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 70%);
    top: -100px;
    right: -100px;
    border-radius: 50%;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--surface);
    border-radius: 20px;
    padding: 40px;
    box-shadow: var(--shadow-lg);
    transform: translateY(0);
    animation: slideUp 0.6s ease forwards;
}

@keyframes slideUp {
    0% {
        transform: translateY(30px);
        opacity: 0;
    }

    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

.brand-logo {
    text-align: center;
    margin-bottom: 30px;
}

.brand-logo img {
    max-height: 60px;
    object-fit: contain;
}

.login-title {
    font-size: 24px;
    margin-bottom: 10px;
    text-align: center;
}

.login-subtitle {
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
    position: relative;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
}

.form-control {
    width: 100%;
    padding: 14px 18px;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    font-size: 15px;
    color: var(--text-main);
    background: #fbfbfc;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--surface);
    box-shadow: 0 0 0 4px rgba(123, 94, 240, 0.1);
}

.btn-primary {
    width: 100%;
    padding: 15px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(123, 94, 240, 0.3);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(123, 94, 240, 0.4);
}

/* --- DASHBOARD LAYOUT --- */
.app-wrapper {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    position: relative;
    z-index: 100;
}

.sidebar-collapsed {
    width: var(--sidebar-min);
}

.sidebar-head {
    height: 80px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    border-bottom: 1px solid var(--border);
    justify-content: center;
}

.sidebar-head img {
    max-height: 40px;
    transition: var(--transition);
}

.sidebar-collapsed .sidebar-head img {
    max-height: 30px;
}

.sidebar-nav {
    padding: 20px 10px;
    flex: 1;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    margin-bottom: 8px;
    border-radius: 10px;
    color: var(--text-muted);
    font-weight: 500;
    cursor: pointer;
    position: relative;
}

.nav-item:hover {
    color: var(--primary);
    background: rgba(123, 94, 240, 0.05);
}

.nav-item i {
    font-size: 20px;
    width: 24px;
    text-align: center;
    margin-right: 15px;
}

.sidebar-collapsed .nav-item .nav-text {
    display: none;
}

.sidebar-collapsed .nav-item i {
    margin-right: 0;
}

.nav-item.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 10px rgba(123, 94, 240, 0.3);
}

.nav-item.active i {
    color: white;
}

/* Toggle Button */
.sidebar-toggle {
    position: absolute;
    top: 25px;
    right: -15px;
    width: 30px;
    height: 30px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-main);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    z-index: 101;
}

.sidebar-toggle:hover {
    background: var(--bg-color);
    color: var(--primary);
    transform: scale(1.1);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-color);
}

.topbar {
    height: 80px;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
}

.breadcrumb {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.breadcrumb span.current {
    color: var(--text-main);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 24px;
    display: block;
    margin-top: 5px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.profile-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--surface);
    padding: 5px 15px 5px 5px;
    border-radius: 50px;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
}

.profile-pill img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.profile-pill .name {
    font-size: 13px;
    font-weight: 600;
}

.content-scroll {
    flex: 1;
    padding: 20px 40px 40px;
    overflow-y: auto;
}

/* CRM Pipeline Cards */
.pipeline-header {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 1px;
    margin-bottom: 20px;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.crm-card {
    background: var(--surface);
    border-radius: 20px;
    padding: 30px;
    box-shadow: var(--shadow-md);
    text-align: center;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.crm-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.crm-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    border-radius: 0 0 20px 20px;
}

.card-hot::after {
    background: var(--hot);
}

.card-warm::after {
    background: var(--warm);
}

.card-cold::after {
    background: var(--cold);
}

.card-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 15px;
    letter-spacing: 0.5px;
}

.card-value {
    font-size: 48px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.card-value i {
    font-size: 32px;
    opacity: 0.15;
}

.val-hot {
    color: var(--hot);
}

.val-warm {
    color: var(--warm);
}

.val-cold {
    color: var(--cold);
}

.card-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 10px;
    font-weight: 500;
}

/* Data Table Panel */
.table-panel {
    background: var(--surface);
    border-radius: 20px;
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.table-header {
    padding: 25px 30px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.table-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main);
}

.table-actions {
    display: flex;
    gap: 10px;
}

.filter-btn {
    padding: 8px 15px;
    background: var(--bg-color);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
}

.filter-btn.active {
    background: rgba(123, 94, 240, 0.1);
    color: var(--primary);
    border-color: var(--primary);
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.crm-table {
    width: 100%;
    border-collapse: collapse;
}

.crm-table th {
    padding: 18px 30px;
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
}

.crm-table td {
    padding: 18px 30px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-main);
}

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

.crm-table tr {
    transition: var(--transition);
}

.crm-table tr:hover {
    background: rgba(244, 247, 254, 0.5);
}

/* Badges specifically colored */
.badge-hot {
    background: rgba(255, 91, 91, 0.1);
    border: 1px solid rgba(255, 91, 91, 0.3);
    color: var(--hot);
}

.badge-warm {
    background: rgba(246, 153, 39, 0.1);
    border: 1px solid rgba(246, 153, 39, 0.3);
    color: var(--warm);
}

.badge-cold {
    background: rgba(0, 185, 228, 0.1);
    border: 1px solid rgba(0, 185, 228, 0.3);
    color: var(--cold);
}

.btn-icon {
    background: var(--primary);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 2px 5px rgba(123, 94, 240, 0.3);
}

.btn-icon:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(123, 94, 240, 0.4);
}

/* Mobile fixes */
@media (max-width: 991px) {
    .login-right {
        display: none;
    }

    .sidebar {
        position: fixed;
        height: 100%;
        transform: translateX(-100%);
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .topbar {
        padding: 0 20px;
    }

    .content-scroll {
        padding: 20px;
    }
}