/* =========================================
   MODERN DASHBOARD - PREMIUM DESIGN
   ========================================= */
:root {
    /* Layout */
    --sidebar-width: 280px;
    --sidebar-collapsed: 80px;
    --header-height: 72px;
    --footer-height: 60px;
    
    /* LinkedIn Blue Theme - Enhanced */
    --primary: #0A66C2;
    --primary-dark: #004182;
    --primary-light: #378FE9;
    --primary-lighter: #5B9FE3;
    --secondary: #0A66C2;
    --success: #057642;
    --danger: #CC1016;
    --warning: #F5B400;
    --info: #0073B1;
    
    /* Neutrals - Premium Palette */
    --white: #ffffff;
    --gray-50: #F8FAFC;
    --gray-100: #F1F5F9;
    --gray-200: #E2E8F0;
    --gray-300: #CBD5E1;
    --gray-400: #94A3B8;
    --gray-500: #64748B;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1E293B;
    --gray-900: #0F172A;
    
    /* Shadows - Depth System */
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    
    /* Transitions - Smooth */
    --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;
}

/* =========================================
   GLOBAL RESET & BASE
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Helvetica Neue', sans-serif;
    background: var(--gray-50);
    color: var(--gray-800);
    font-size: 15px;
    line-height: 1.6;
    overflow: hidden;
    height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* =========================================
   DASHBOARD CONTAINER
   ========================================= */
.dashboard-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
    background: var(--gray-50);
}

/* =========================================
   SIDEBAR - PREMIUM DESIGN
   ========================================= */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--white);
    border-right: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1000;
    flex-shrink: 0;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
}

/* Collapsed State */
.sidebar.collapsed {
    width: var(--sidebar-collapsed);
}

.sidebar.collapsed .item-text {
    opacity: 0;
    visibility: hidden;
    width: 0;
    overflow: hidden;
}

/* Logo switching */
.sidebar .nav-brand-full {
    display: block;
    max-width: 180px;
    height: auto;
    transition: var(--transition);
}

.sidebar .nav-brand-icon {
    display: none;
    width: 40px;
    height: 40px;
    transition: var(--transition);
}

.sidebar.collapsed .nav-brand-full {
    display: none;
}

.sidebar.collapsed .nav-brand-icon {
    display: block;
}

.sidebar.collapsed .sidebar-upgrade {
    display: none;
    height: 0;
    padding: 0;
    margin: 0;
    overflow: hidden;
}

.sidebar.collapsed .sidebar-brand {
    justify-content: center;
    padding: 1.5rem 1rem;
}

.sidebar.collapsed .sidebar-item {
    justify-content: center;
    padding: 0.75rem;
    margin-left: 0;
    margin-right: 0;
}

/* Sidebar Brand - Perfect Alignment */
.sidebar-brand {
    height: var(--header-height);
    padding: 0 1.75rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-shrink: 0;
    transition: var(--transition);
    background: var(--white);
}

.navbar-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    width: 100%;
}

.nav-brand-img {
    transition: var(--transition);
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    padding: 1.5rem 1rem;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: var(--radius-full);
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1.25rem;
    margin-bottom: 0.5rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--gray-600);
    font-size: 0.9375rem;
    font-weight: 500;
    text-align: left;
    width: 100%;
    cursor: pointer;
    transition: var(--transition-fast);
    position: relative;
}

.sidebar-item i {
    font-size: 1.25rem;
    flex-shrink: 0;
    width: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.sidebar-item .item-text {
    flex: 1;
    white-space: nowrap;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                visibility 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-item:hover {
    background: var(--gray-100);
    color: var(--gray-900);
    transform: translateX(4px);
}

/* Collapsed sidebar hover - no translateX */
.sidebar.collapsed .sidebar-item:hover {
    transform: translateX(0);
}

.sidebar-item.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(10, 102, 194, 0.3);
    font-weight: 600;
}

.sidebar-item.active:hover {
    transform: translateX(0);
    box-shadow: 0 6px 16px rgba(10, 102, 194, 0.4);
}

/* Collapsed Sidebar - Centered Active State */
.sidebar.collapsed .sidebar-item {
    width: auto;
    min-width: 48px;
}

.sidebar.collapsed .sidebar-item.active {
    width: 44px;
    height: 44px;
    padding: 0;
    margin-left: auto;
    margin-right: auto;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(10, 102, 194, 0.25);
}

.sidebar.collapsed .sidebar-item.active:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(10, 102, 194, 0.35);
}

.sidebar.collapsed .sidebar-item.active i {
    font-size: 1.125rem;
}

/* =========================================
   SIDEBAR UPGRADE CARD
   ========================================= */
.sidebar-upgrade {
    padding: 1.5rem;
    margin: 0;
    border-top: 1px solid var(--gray-200);
    background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 100%);
    flex-shrink: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    height: auto;
}

.upgrade-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    transition: var(--transition);
}

.upgrade-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #F59E0B 0%, #F97316 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1.375rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.upgrade-info {
    flex: 1;
    min-width: 0;
}

.upgrade-title {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0;
    line-height: 1.4;
}

.upgrade-desc {
    font-size: 0.8125rem;
    color: var(--gray-600);
    margin: 0;
    line-height: 1.4;
}

.btn-upgrade {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    padding: 0.875rem 1.25rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: var(--white);
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    width: 100%;
    box-shadow: 0 4px 12px rgba(10, 102, 194, 0.25);
}

.btn-upgrade:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(10, 102, 194, 0.35);
}

.btn-upgrade:active {
    transform: translateY(0);
}

.btn-upgrade i {
    font-size: 1.125rem;
}

/* =========================================
   SIDEBAR TOGGLE BUTTON - REDESIGNED
   ========================================= */
.sidebar-toggle {
    position: fixed;
    left: var(--sidebar-width);
    top: calc(var(--header-height) / 2);
    transform: translate(-50%, -50%);
    width: 36px;
    height: 36px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1001;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.sidebar-toggle:hover {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 4px 16px rgba(10, 102, 194, 0.3);
}

.sidebar-toggle i {
    font-size: 1rem;
    color: var(--gray-600);
    transition: var(--transition-fast);
}

.sidebar-toggle:hover i {
    color: var(--white);
}

.sidebar.collapsed ~ .sidebar-toggle {
    left: var(--sidebar-collapsed);
}

.sidebar.collapsed ~ .sidebar-toggle i {
    transform: rotate(180deg);
}

/* =========================================
   MOBILE MENU
   ========================================= */
.mobile-menu-btn {
    position: fixed;
    top: 1.25rem;
    left: 1.25rem;
    width: 48px;
    height: 48px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1002;
    box-shadow: var(--shadow-md);
    transition: var(--transition-fast);
}

.mobile-menu-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
}

.mobile-menu-btn i {
    font-size: 1.5rem;
    color: var(--gray-700);
    transition: var(--transition-fast);
}

.mobile-menu-btn:hover i {
    color: var(--white);
}

@media (max-width: 991.98px) {
    .mobile-menu-btn {
        display: flex;
    }
    
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        transform: translateX(-100%);
        z-index: 1050;
        box-shadow: var(--shadow-2xl);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1040;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.show {
    display: block;
    opacity: 1;
}

@media (min-width: 992px) {
    .sidebar-overlay {
        display: none !important;
    }
}

/* =========================================
   MAIN AREA
   ========================================= */
.main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--gray-50);
    overflow: hidden;
}

/* =========================================
   TOP HEADER - PERFECT ALIGNMENT
   ========================================= */
.top-header {
    height: var(--header-height);
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    padding: 0 2rem;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    box-shadow: var(--shadow-xs);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 2rem;
    min-width: 0;
}

/* Page Title */
.page-title {
    flex-shrink: 0;
    min-width: 0;
}

.page-title-text {
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    font-weight: 700;
    color: var(--gray-900);
    margin: 0;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: auto;
    flex-shrink: 0;
}

/* Header Search */
.header-search {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    background: var(--gray-100);
    border: 1px solid transparent;
    border-radius: var(--radius-full);
    color: var(--gray-500);
    font-size: 0.9375rem;
    cursor: pointer;
    transition: var(--transition-fast);
    min-width: 200px;
}

.header-search:hover {
    border-color: var(--gray-300);
    background: var(--white);
    box-shadow: var(--shadow-sm);
}

.header-search i {
    font-size: 1.125rem;
    flex-shrink: 0;
}

.search-text {
    white-space: nowrap;
}

.header-icon-btn {
    position: relative;
    width: 48px;
    height: 48px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
    flex-shrink: 0;
}

.header-icon-btn:hover {
    background: var(--gray-100);
    border-color: var(--gray-300);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.header-icon-btn i {
    font-size: 1.25rem;
    color: var(--gray-600);
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    background: linear-gradient(135deg, var(--danger) 0%, #DC2626 100%);
    color: var(--white);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6875rem;
    font-weight: 700;
    border: 2px solid var(--white);
    box-shadow: 0 2px 8px rgba(204, 16, 22, 0.3);
}

/* Profile Button */
.profile-btn {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.5rem 1rem;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
    min-width: 0;
}

.profile-btn:hover {
    background: var(--gray-100);
    border-color: var(--gray-300);
    box-shadow: var(--shadow-sm);
}

.profile-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1.125rem;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(10, 102, 194, 0.2);
}

.profile-info {
    display: flex;
    flex-direction: column;
    text-align: left;
    min-width: 0;
    max-width: 150px;
}

.profile-name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--gray-900);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-role {
    font-size: 0.8125rem;
    color: var(--gray-500);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chevron-icon {
    font-size: 0.875rem;
    color: var(--gray-400);
    transition: var(--transition-fast);
    flex-shrink: 0;
}

.profile-btn[aria-expanded="true"] .chevron-icon {
    transform: rotate(180deg);
}

/* Profile Dropdown Menu - Premium */
.profile-dropdown-menu {
    min-width: 320px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-2xl);
    margin-top: 0.75rem;
    padding: 0;
    overflow: hidden;
}

.profile-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    padding: 1.5rem;
    border-radius: 0;
}

.profile-avatar-large {
    width: 64px;
    height: 64px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1.75rem;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.dropdown-item {
    padding: 0.875rem 1.5rem;
    font-size: 0.9375rem;
    color: var(--gray-700);
    transition: var(--transition-fast);
    font-weight: 500;
}

.dropdown-item:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

.dropdown-item i {
    width: 24px;
    text-align: center;
}

/* =========================================
   CONTENT AREA
   ========================================= */
.content-area {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 2rem;
    min-width: 0;
}

.content-area::-webkit-scrollbar {
    width: 8px;
}

.content-area::-webkit-scrollbar-track {
    background: var(--gray-100);
}

.content-area::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: var(--radius-full);
}

.content-area::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

/* =========================================
   FOOTER - PERFECT ALIGNMENT
   ========================================= */
.main-footer {
    height: var(--footer-height);
    background: var(--white);
    border-top: 1px solid var(--gray-200);
    padding: 0 2rem;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    font-size: 0.875rem;
    color: var(--gray-500);
    font-weight: 500;
}

.footer-left,
.footer-right {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.footer-separator {
    color: var(--gray-300);
}

@media (max-width: 767.98px) {
    .footer-content {
        flex-direction: column;
        gap: 0.375rem;
        padding: 0.5rem 0;
    }
    
    .footer-left,
    .footer-right {
        font-size: 0.8125rem;
    }
}

/* =========================================
   CARDS - BREATHTAKING DESIGN
   ========================================= */
.card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--gray-300);
    transform: translateY(-2px);
}

.card-header {
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    padding: 1.25rem 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    font-size: 1.125rem;
}

.card-body {
    padding: 1.5rem;
}

.gradient-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: var(--white);
    border: none;
    box-shadow: 0 8px 24px rgba(10, 102, 194, 0.25);
}

.gradient-card:hover {
    box-shadow: 0 12px 32px rgba(10, 102, 194, 0.35);
}

.icon-box {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    box-shadow: var(--shadow-md);
}

.gradient-blue {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: var(--white);
}

.gradient-purple {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: var(--white);
}

.gradient-orange {
    background: linear-gradient(135deg, #F59E0B 0%, #F97316 100%);
    color: var(--white);
}

.gradient-green {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    color: var(--white);
}

/* =========================================
   BUTTONS - PREMIUM
   ========================================= */
.btn-gradient {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: var(--white);
    border: none;
    padding: 0.875rem 1.75rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.9375rem;
    transition: var(--transition-fast);
    box-shadow: 0 4px 12px rgba(10, 102, 194, 0.25);
}

.btn-gradient:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(10, 102, 194, 0.35);
    color: var(--white);
}

.btn-gradient:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border: none;
    border-radius: var(--radius-md);
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(10, 102, 194, 0.25);
    transition: var(--transition-fast);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(10, 102, 194, 0.35);
}

.btn-outline-primary {
    border: 2px solid var(--primary);
    color: var(--primary);
    border-radius: var(--radius-md);
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: var(--transition-fast);
}

.btn-outline-primary:hover {
    background: var(--primary);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(10, 102, 194, 0.25);
}

/* =========================================
   TABLES - MODERN DESIGN WITH SCROLL
   ========================================= */
.table-responsive {
    overflow-x: auto;
    /* Changed from hidden to visible so dropdowns aren't cut off */
    overflow-y: visible; 
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-lg);
}

.table-responsive::-webkit-scrollbar {
    height: 8px;
}

.table-responsive::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: var(--radius-full);
}

.table-responsive::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: var(--radius-full);
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

.app-table {
    font-size: 0.9375rem;
    width: 100%;
    min-width: 800px;
    margin-bottom: 0;
    /* Ensure table layout doesn't collapse pills */
    border-collapse: separate;
    border-spacing: 0;
}

.app-table thead th {
    background: var(--gray-100);
    border-bottom: 2px solid var(--gray-300);
    font-weight: 700;
    color: var(--gray-700);
    padding: 1rem 1.25rem;
    text-align: left;
    text-transform: uppercase;
    font-size: 0.8125rem;
    letter-spacing: 0.05em;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 10;
}

.app-table tbody td {
    padding: 1.25rem;
    /* CRITICAL FIX: Ensures everything stays centered vertically */
    vertical-align: middle; 
    border-bottom: 1px solid var(--gray-200);
    color: var(--gray-700);
    /* CRITICAL FIX: Stops text from overlapping inside the cell */
    white-space: nowrap; 
}

.app-table tbody tr {
    transition: var(--transition-fast);
    background: var(--white);
}

.app-table tbody tr:hover {
    background: var(--gray-50);
}

/* =========================================
   BADGES - VIBRANT
   ========================================= */
.badge {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.025em;
    white-space: nowrap;
}

.badge-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: var(--white);
    box-shadow: 0 2px 8px rgba(10, 102, 194, 0.25);
}

.badge-success {
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
    color: var(--white);
    box-shadow: 0 2px 8px rgba(5, 118, 66, 0.25);
}

.badge-warning {
    background: linear-gradient(135deg, var(--warning) 0%, #F97316 100%);
    color: var(--white);
    box-shadow: 0 2px 8px rgba(245, 180, 0, 0.25);
}

.status-badge {
    padding: 0.6rem 1.2rem; /* Increased padding for better breathing room */
    border-radius: var(--radius-full);
    font-size: 0.8125rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    /* CRITICAL FIX: Prevents text from overlapping border */
    white-space: nowrap; 
    min-width: 100px;
    line-height: 1;
}

/* FIX for the Form Selects in Edit Mode */
.app-table .form-select-sm {
    border-radius: var(--radius-full);
    font-size: 0.8125rem;
    padding: 0.4rem 2rem 0.4rem 1rem;
    border: 1px solid var(--gray-300);
    min-width: 140px;
}

.status-hot {
    background: linear-gradient(135deg, #FEE2E2 0%, #FECACA 100%);
    color: var(--danger);
}

.status-warm {
    background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
    color: #D97706;
}

.status-cold {
    background: linear-gradient(135deg, #DBEAFE 0%, #BFDBFE 100%);
    color: var(--primary);
}

/* =========================================
   ACTION BUTTONS - REFINED
   ========================================= */
.action-btn {
    width: 36px; /* Slightly smaller to fit better in the row */
    height: 36px;
    border-radius: var(--radius-md);
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
}

.action-btn-linkedin {
    background: linear-gradient(135deg, #DBEAFE 0%, #BFDBFE 100%);
    color: var(--primary);
}

.action-btn-linkedin:hover {
    background: var(--primary);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(10, 102, 194, 0.25);
}

.action-btn-edit {
    background: var(--gray-100);
    color: var(--gray-700);
}

.action-btn-edit:hover {
    background: var(--gray-800);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.action-btn-delete {
    background: linear-gradient(135deg, #FEE2E2 0%, #FECACA 100%);
    color: var(--danger);
}

.action-btn-delete:hover {
    background: var(--danger);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(204, 16, 22, 0.25);
}

.action-btn-save {
    background: var(--success);
    color: white;
}

.action-btn-cancel {
    background: var(--gray-400);
    color: white;
}

/* =========================================
   PAGINATION - MODERN
   ========================================= */
.pagination {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.page-link {
    padding: 0.75rem 1.125rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-200);
    color: var(--gray-700);
    font-weight: 600;
    transition: var(--transition-fast);
}

.page-link:hover {
    background: var(--gray-100);
    border-color: var(--primary);
    color: var(--primary);
}

.page-item.active .page-link {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-color: transparent;
    color: var(--white);
    box-shadow: 0 4px 12px rgba(10, 102, 194, 0.25);
}

.page-item.disabled .page-link {
    color: var(--gray-300);
    background: var(--white);
    cursor: not-allowed;
    opacity: 0.6;
}

/* =========================================
   MODALS - STUNNING DESIGN
   ========================================= */
.modal-content {
    border-radius: var(--radius-xl);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-2xl);
    overflow: hidden;
}

.modal-header {
    border-bottom: 1px solid var(--gray-200);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: var(--white);
    padding: 1.5rem 2rem;
}

.modal-header .modal-title {
    font-weight: 700;
    font-size: 1.25rem;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
    opacity: 0.8;
}

.modal-header .btn-close:hover {
    opacity: 1;
}

.modal-body {
    padding: 2rem;
}

.modal-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
}

.modal-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    flex-shrink: 0;
    box-shadow: var(--shadow-md);
}

.gradient-info {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: var(--white);
}

.gradient-danger {
    background: linear-gradient(135deg, var(--danger) 0%, #DC2626 100%);
    color: var(--white);
}

.logout-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    flex-shrink: 0;
}

.logout-icon-blue {
    background: linear-gradient(135deg, #DBEAFE 0%, #BFDBFE 100%);
    color: var(--primary);
}

/* =========================================
   PROFILE OPTIMIZER
   ========================================= */
#profileView {
    max-width: 100%;
    overflow-x: hidden;
}

.score-circle {
    width: 160px;
    height: 160px;
    border-radius: var(--radius-full);
    border: 10px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.score-value {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1;
}

.score-label {
    font-size: 0.9375rem;
    opacity: 0.95;
    margin-top: 0.375rem;
    font-weight: 600;
}

.score-badge {
    position: absolute;
    bottom: -8px;
    right: -8px;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #F59E0B 0%, #F97316 100%);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1.375rem;
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.4);
    border: 4px solid var(--white);
}

.profile-sections-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    max-width: 900px;
    min-width: 0;
}

.profile-section-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    min-width: 0;
}

.profile-section-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--gray-300);
}

.profile-section-card.is-open {
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.profile-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    cursor: pointer;
    user-select: none;
    background: var(--white);
    transition: var(--transition-fast);
    min-width: 0;
    gap: 1rem;
}

.profile-section-header:hover {
    background: var(--gray-50);
}

.profile-section-card.is-open .profile-section-header {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
}

.profile-section-info {
    flex: 1;
    min-width: 0;
}

.profile-section-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
    line-height: 1.4;
    word-wrap: break-word;
}

.profile-section-meta {
    font-size: 0.875rem;
    color: var(--gray-500);
    font-weight: 500;
    word-wrap: break-word;
}

.profile-section-toggle {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-200);
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
    flex-shrink: 0;
}

.profile-section-toggle:hover {
    background: var(--gray-100);
    border-color: var(--gray-300);
}

.profile-section-card.is-open .profile-section-toggle {
    background: var(--primary);
    border-color: var(--primary);
}

.profile-section-toggle-icon {
    font-size: 1.125rem;
    color: var(--gray-600);
    transition: var(--transition);
}

.profile-section-toggle:hover .profile-section-toggle-icon {
    color: var(--gray-900);
}

.profile-section-card.is-open .profile-section-toggle-icon {
    transform: rotate(180deg);
    color: var(--white);
}

.profile-section-body {
    padding: 0;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: var(--transition);
    word-wrap: break-word;
}

.profile-section-card.is-open .profile-section-body {
    padding: 1.5rem;
    max-height: 2000px;
    opacity: 1;
}

.profile-section-body ul {
    margin: 0;
    padding-left: 1.5rem;
    list-style: none;
}

.profile-section-body li {
    margin-bottom: 1rem;
    color: var(--gray-700);
    font-size: 0.9375rem;
    line-height: 1.7;
    position: relative;
    padding-left: 0.5rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.profile-section-body li::before {
    content: "•";
    position: absolute;
    left: -1rem;
    color: var(--primary);
    font-weight: 700;
    font-size: 1.25rem;
}

.profile-section-body li:last-child {
    margin-bottom: 0;
}

/* =========================================
   SETTINGS VIEW
   ========================================= */
#settingsView .nav-tabs {
    border-bottom: 2px solid var(--gray-200);
}

#settingsView .nav-tabs .nav-link {
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--gray-600);
    font-weight: 600;
    padding: 1rem 1.75rem;
    transition: var(--transition-fast);
    font-size: 0.9375rem;
}

#settingsView .nav-tabs .nav-link:hover {
    color: var(--primary);
    background: var(--gray-50);
}

#settingsView .nav-tabs .nav-link.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: transparent;
}

#settingsView .form-control,
#settingsView .form-select {
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-300);
    padding: 0.875rem 1.125rem;
    font-size: 0.9375rem;
}

#settingsView .form-control:focus,
#settingsView .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(10, 102, 194, 0.15);
}

/* =========================================
   LEAD CARD (MOBILE)
   ========================================= */
.lead-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid var(--gray-200);
    transition: var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.lead-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--gray-300);
    transform: translateY(-2px);
}

.lead-avatar {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: 700;
    font-size: 0.9375rem;
    box-shadow: var(--shadow-md);
}

/* =========================================
   PLAN CARDS
   ========================================= */
.plan-card {
    transition: var(--transition);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
}

.plan-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: var(--gray-300);
}

.plan-card.popular-plan {
    border: 2px solid var(--primary);
    box-shadow: 0 8px 24px rgba(10, 102, 194, 0.15);
}

.plan-card.popular-plan:hover {
    box-shadow: 0 12px 32px rgba(10, 102, 194, 0.25);
}

/* =========================================
   UTILITIES
   ========================================= */
.text-primary {
    color: var(--primary) !important;
}

.bg-primary {
    background-color: var(--primary) !important;
}

.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%) !important;
}

.gradient-bg {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
}

.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* =========================================
   ANIMATIONS
   ========================================= */
.rotating {
    animation: rotate 1s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.4s ease-out;
}

/* =========================================
   RESPONSIVE TABLE/CARD VIEWS
   ========================================= */
@media (max-width: 991.98px) {
    #leadsTableCard,
    #commentsTableCard {
        display: none !important;
    }
    
    #leadsCards,
    #commentsCards {
        display: block !important;
    }
}

@media (min-width: 992px) {
    #leadsTableCard,
    #commentsTableCard {
        display: flex !important;
    }
    
    #leadsCards,
    #commentsCards {
        display: none !important;
    }
}

/* =========================================
   RESPONSIVE LAYOUTS
   ========================================= */
@media (max-width: 1199.98px) {
    .header-search {
        min-width: 160px;
    }
}

@media (max-width: 991.98px) {
    .content-area {
        padding: 1.5rem;
    }
    
    .top-header {
        padding: 0 1.5rem;
        padding-left: 5rem;
    }
    
    .page-title-text {
        font-size: 1.5rem;
    }
}

@media (max-width: 767.98px) {
    .content-area {
        padding: 1rem;
    }
    
    .top-header {
        padding: 0 1rem;
        padding-left: 4.5rem;
        height: 64px;
    }
    
    .header-search {
        min-width: 0;
        width: 48px;
        padding: 0.75rem;
    }
    
    .header-search .search-text {
        display: none;
    }
    
    .profile-info {
        display: none !important;
    }
    
    .chevron-icon {
        display: none;
    }
}

@media (max-width: 575.98px) {
    .content-area {
        padding: 0.75rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .modal-body {
        padding: 1.5rem;
    }
    
    .modal-header,
    .modal-footer {
        padding: 1rem 1.5rem;
    }
}

/* =========================================
   FORM CONTROLS
   ========================================= */
.form-control,
.form-select {
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-300);
    padding: 0.875rem 1.125rem;
    font-size: 0.9375rem;
    transition: var(--transition-fast);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(10, 102, 194, 0.15);
    outline: none;
}

.form-label {
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
    font-size: 0.9375rem;
}

/* =========================================
   PROGRESS BARS
   ========================================= */
.progress {
    height: 8px;
    border-radius: var(--radius-full);
    background: var(--gray-200);
    overflow: hidden;
}

.progress-bar {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: var(--radius-full);
    transition: width 0.6s ease;
}

/* =========================================
   LINKS
   ========================================= */
a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition-fast);
}

a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* =========================================
   REDUCED MOTION
   ========================================= */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
/* Current plan badge using LinkedIn blue theme */
.badge-purple {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(10, 102, 194, 0.35);
  border-radius: var(--radius-full);
  padding: 0.35rem 0.9rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

/* Blue highlight for info icon */
.text-purple {
  color: var(--primary) !important;
}

/* Stronger monthly cap text */
#homeMonthlyCapText {
  font-weight: 600;
  color: var(--gray-700);
}
/* =========================================
   PROFILE OPTIMIZER – TIPS LIST
   ========================================= */

/* Make the section card span full width of the detail area */
#detailTipsList .profile-section-card {
  width: 100%;
}

/* Reset list styling and add line between every tip */
#detailTipsList .profile-section-body ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

#detailTipsList .profile-section-body ul li {
  border-bottom: 1px solid rgba(148, 163, 184, 0.35); /* approx gray-400 */
  padding: 0.5rem 0;
}

#detailTipsList .profile-section-body ul li:last-child {
  border-bottom: none;
}
/* ============================================
   LEAD DETAIL VIEW — WORKSPACE
   ============================================ */

/* Workspace header */
#leadDetailView .workspace-header {
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Back button */
#leadDetailView .back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: #374151;
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  transition: all 0.2s;
}

#leadDetailView .back-btn:hover {
  background: #f3f4f6;
  color: #111827;
}

/* ── Grid layout ── */
#leadDetailView .workspace-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 1.5rem;
}

/* Main content card */
#leadDetailView .workspace-main {
  background: #ffffff;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  min-width: 0;
}

/* ============================================
   PROFILE HEADER — VERTICAL STACK
   ============================================ */
#leadDetailView .profile-header {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0;
  padding-bottom: 1.5rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid #f3f4f6;
  background: transparent;
}

/* Row 1: Avatar + Name */
#leadDetailView .profile-header-top {
  display: flex;
  align-items: center;
  gap: 1rem;
}

#leadDetailView .profile-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #06b6d4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 600;
  color: #ffffff;
  flex-shrink: 0;
}

#leadDetailView .profile-name {
  font-size: 1.5rem;
  font-weight: 600;
  color: #111827;
  margin: 0;
}

/* Row 2: Headline */
#leadDetailView .profile-title {
  color: #6b7280;
  font-size: 0.875rem;
  line-height: 1.5;
}

/* Row 3: Badges */
#leadDetailView .status-badges {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

#leadDetailView .badge.workspace-badge {
  padding: 0.375rem 0.875rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  border: none;
  white-space: nowrap;
  display: inline-block;
  line-height: 1.4;
}

/* Row 4: Meta (date) */
#leadDetailView .profile-meta {
  font-size: 0.8125rem;
  color: #9ca3af;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ============================================
   SECTION HEADINGS
   ============================================ */
#leadDetailView .section-heading {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #111827;
}

/* ============================================
   MESSAGE STAGES
   ============================================ */
#leadDetailView .message-stages-section {
  margin-bottom: 2rem;
}

#leadDetailView .message-stages {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

#leadDetailView .stage-tab {
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.15s;
  font-weight: 500;
  color: #374151;
  white-space: nowrap;
}

#leadDetailView .stage-tab:hover {
  border-color: #3b82f6;
  color: #3b82f6;
}

#leadDetailView .stage-tab.active {
  background: #3b82f6;
  color: #ffffff;
  border-color: #3b82f6;
}

#leadDetailView .stage-info {
  background: #f0fdf4;
  color: #166534;
  padding: 0.875rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  border-left: 3px solid #10b981;
}

/* ============================================
   GENERATED MESSAGE BOX
   ============================================ */
#leadDetailView .generated-message-section {
  margin-bottom: 2rem;
}

#leadDetailView .message-box {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 1.5rem;
}

#leadDetailView .message-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #3b82f6;
  margin-bottom: 1rem;
}

#leadDetailView .message-content {
  color: #374151;
  line-height: 1.7;
  margin-bottom: 1rem;
  font-size: 0.9375rem;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

#leadDetailView .message-hint {
  color: #9ca3af;
  font-size: 0.8125rem;
  font-style: italic;
  margin-bottom: 1.25rem;
  padding-left: 0.5rem;
  border-left: 2px solid #e5e7eb;
}

#leadDetailView .message-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

#leadDetailView .message-actions .btn {
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

/* ============================================
   ALT MESSAGE CARDS
   ============================================ */
#leadDetailView .alt-message-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 0.75rem;
}

#leadDetailView .alt-message-text {
  color: #374151;
  line-height: 1.5;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* ============================================
   NEXT STAGES
   ============================================ */
#leadDetailView .next-stages-section {
  margin-bottom: 1rem;
}

#leadDetailView .next-stages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

#leadDetailView .next-stage-card {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 1.25rem;
  background: #fafafa;
  transition: box-shadow 0.15s, border-color 0.15s;
  cursor: pointer;
}

#leadDetailView .next-stage-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border-color: #d1d5db;
}

#leadDetailView .stage-card-title {
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

#leadDetailView .stage-card-timing {
  font-size: 0.8125rem;
  color: #6b7280;
  margin-bottom: 0.375rem;
}

#leadDetailView .stage-card-desc {
  font-size: 0.8125rem;
  color: #9ca3af;
}

/* ============================================
   SIDEBAR
   ============================================ */
#leadDetailView .workspace-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

#leadDetailView .workspace-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

#leadDetailView .card-heading {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  color: #111827;
}

/* Profile snapshot */
#leadDetailView .info-row {
  margin-bottom: 1.25rem;
}

#leadDetailView .info-row:last-child {
  margin-bottom: 0;
}

#leadDetailView .info-label {
  font-size: 0.75rem;
  color: #6b7280;
  margin-bottom: 0.375rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

#leadDetailView .info-value {
  color: #111827;
  font-size: 0.875rem;
  line-height: 1.5;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* ============================================
   TIMELINE
   ============================================ */
#leadDetailView .timeline-item {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid #f3f4f6;
}

#leadDetailView .timeline-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

#leadDetailView .timeline-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 11px;
  color: #ffffff;
}

#leadDetailView .timeline-content {
  flex: 1;
  min-width: 0;
}

#leadDetailView .timeline-text {
  font-size: 0.875rem;
  color: #374151;
  margin-bottom: 0.25rem;
  font-weight: 500;
}

#leadDetailView .timeline-time {
  font-size: 0.75rem;
  color: #9ca3af;
}

/* ============================================
   QUICK ACTIONS
   ============================================ */
#leadDetailView .quick-action-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.875rem 0;
  border-bottom: 1px solid #f3f4f6;
  gap: 0.75rem;
}

#leadDetailView .quick-action-item:first-child {
  padding-top: 0;
}

#leadDetailView .quick-action-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

#leadDetailView .quick-action-label {
  font-size: 0.875rem;
  color: #374151;
  min-width: 0;
  word-wrap: break-word;
}

#leadDetailView .quick-action-btn {
  padding: 0.375rem 0.875rem;
  background: #10b981;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
  flex-shrink: 0;
  white-space: nowrap;
}

#leadDetailView .quick-action-btn:hover {
  background: #059669;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1200px) {
  #leadDetailView .workspace-container {
    grid-template-columns: 1fr;
  }

  #leadDetailView .workspace-sidebar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
  }
}

@media (max-width: 768px) {
  #leadDetailView .workspace-header {
    padding: 0.75rem 1rem;
  }

  #leadDetailView .workspace-container {
    padding: 1rem;
  }

  #leadDetailView .workspace-main,
  #leadDetailView .workspace-card {
    padding: 1.25rem;
  }

  #leadDetailView .workspace-sidebar {
    grid-template-columns: 1fr;
  }

  #leadDetailView .next-stages-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  #leadDetailView .profile-header-top {
    gap: 0.75rem;
  }

  #leadDetailView .profile-name {
    font-size: 1.25rem;
  }

  #leadDetailView .profile-avatar {
    width: 48px;
    height: 48px;
    font-size: 18px;
  }

  #leadDetailView .message-stages {
    flex-direction: column;
  }

  #leadDetailView .stage-tab {
    width: 100%;
    text-align: center;
  }

  #leadDetailView .message-box {
    padding: 1rem;
  }
}

/* Only stack buttons on very small screens */
@media (max-width: 380px) {
  #leadDetailView .message-actions {
    flex-direction: column;
  }

  #leadDetailView .message-actions .btn {
    width: 100%;
    justify-content: center;
  }
}