/* Easy CRM - Professional Light Theme Stylesheet */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Professional color palette */
    --primary: #1E40AF;
    --primary-dark: #1E3A8A;
    --secondary: #64748B;
    --accent: #0891B2;
    --success: #059669;
    --danger: #DC2626;
    --warning: #D97706;
    
    /* Backgrounds */
    --bg-main: #F8FAFC;
    --bg-card: #FFFFFF;
    --bg-sidebar: #FFFFFF;
    --bg-hover: #F1F5F9;
    
    /* Text colors */
    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-muted: #94A3B8;
    
    /* Borders */
    --border-color: #E2E8F0;
    --border-light: #F1F5F9;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Bootstrap Icons - Navigation sizing */
.nav-icon {
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    flex-shrink: 0;
}

/* Bootstrap Icons - Action button sizing */
.icon-edit, .icon-delete {
    font-size: 15px;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    justify-content: flex-start;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid #E5E7EB; /* Add border */
    background: white;
    color: #6B7280;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 6px;
    flex-shrink: 0;
}

.btn-icon i {
    font-size: 1.1rem;
}

/* Default hover */
.btn-icon:hover {
    border-color: #D1D5DB;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* View icon - Blue */
.btn-icon[title*="View"]:hover,
.btn-icon[title*="Details"]:hover {
    color: #3B82F6;
    background: #EFF6FF;
    border-color: #BFDBFE;
}

/* Edit icon - Purple */
.btn-icon[title*="Edit"]:hover {
    color: #8B5CF6;
    background: #F5F3FF;
    border-color: #DDD6FE;
}

/* Website/Globe icon - Green */
.btn-icon[title*="Website"]:hover,
.btn-icon[title*="Visit"]:hover {
    color: #10B981;
    background: #ECFDF5;
    border-color: #A7F3D0;
}

/* Email icon - Yellow/Orange */
.btn-icon[title*="Email"]:hover,
.btn-icon[title*="Mail"]:hover {
    color: #F59E0B;
    background: #FFFBEB;
    border-color: #FDE68A;
}

/* Call/Phone icon - Cyan */
.btn-icon[title*="Call"]:hover,
.btn-icon[title*="Phone"]:hover {
    color: #06B6D4;
    background: #ECFEFF;
    border-color: #A5F3FC;
}

/* Delete icon - Red */
.btn-icon[title*="Delete"]:hover {
    color: #EF4444;
    background: #FEF2F2;
    border-color: #FECACA;
}

/* Ensure consistent across all tables */
.data-table .btn-icon,
.ls-table .btn-icon,
table .btn-icon {
    border: 1px solid #E5E7EB;
    background: white;
}

/* Form buttons (delete forms) */
form .btn-icon {
    border: 1px solid #E5E7EB;
    background: white;
}

form .btn-icon:hover {
    color: #EF4444;
    background: #FEF2F2;
    border-color: #FECACA;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.02em;
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #EEF2FF 0%, #DBEAFE 50%, #FEF3C7 100%);
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.login-decoration {
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    top: -200px;
    right: -200px;
}

.login-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 3rem;
    max-width: 450px;
    width: 100%;
    box-shadow: var(--shadow-lg);
    position: relative;
    border: 1px solid var(--border-color);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

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

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

.input, input[type="text"], input[type="email"], input[type="password"], 
input[type="tel"], input[type="number"], textarea, select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    background: var(--bg-card);
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.input:focus, input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.2);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-outline:hover {
    background: var(--bg-hover);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-danger {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-danger:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
    color: var(--primary);
}

/* Demo Credentials */
.demo-credentials {
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--bg-hover);
    border-radius: 8px;
    text-align: center;
}

.demo-credentials p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.demo-credentials code {
    font-family: 'Courier New', monospace;
    color: var(--primary);
    font-size: 0.875rem;
    background: var(--bg-card);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

/* Error/Success Messages */
.message {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.message-error {
    background: #FEE2E2;
    color: #991B1B;
    border: 1px solid #FCA5A5;
}

.message-success {
    background: #D1FAE5;
    color: #065F46;
    border: 1px solid #6EE7B7;
}

/* Main App Layout */
.app-container {
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
    width: 100%;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
}

.sidebar-header {
    padding: 2rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header h2 {
    font-size: 1.75rem;
    color: var(--primary);
    margin-bottom: 0.25rem;
}

.sidebar-header p {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    font-weight: 500;
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.1) 0%, transparent 100%);
    color: var(--primary);
    border-left-color: var(--primary);
}

.nav-icon {
    font-size: 1.25rem;
}

.sidebar-footer {
    padding: 1.5rem 1.5rem 0.5rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sidebar-copyright {
    margin-top: auto;
    text-align: center;
}

.sidebar-copyright p {
    font-size: 0.8rem; /* Increased size */
    color: var(--text-muted);
    margin: 0;
    line-height: 1.4;
    font-weight: 500;
}


.sidebar-footer .btn {
    width: 100%;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 2rem;
    min-height: 100vh;
    min-width: 0;
    max-width: calc(100vw - 260px);
    overflow-x: hidden;
    box-sizing: border-box;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 2.25rem;
    margin-bottom: 0.5rem;
}

.page-header p {
    color: var(--text-secondary);
}

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card h3 {
    font-size: 1.25rem;
    margin-bottom: 1.25rem;
    color: var(--text-primary);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: linear-gradient(135deg, var(--bg-card) 0%, #F8FAFC 100%);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.1) 0%, transparent 70%);
    transform: translate(30%, -30%);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
}

.accent-blue { color: #3B82F6; }
.accent-green { color: var(--success); }
.accent-orange { color: var(--accent); }
.accent-red { color: var(--danger); }

/* Grid Layouts */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Sources List */
.source-item {
    margin-bottom: 1rem;
}

.source-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.source-name {
    color: var(--text-primary);
    font-weight: 500;
}

.source-percentage {
    color: var(--primary);
    font-weight: 600;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--border-light);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Status Grid */
.status-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.status-item {
    padding: 1rem;
    background: var(--bg-hover);
    border-radius: 8px;
    border-left: 4px solid var(--primary);
}

.status-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.status-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

/* Activity List */
.activity-item {
    display: flex;
    align-items: start;
    gap: 0.75rem;
    padding: 0.875rem;
    background: var(--bg-hover);
    border-radius: 8px;
    margin-bottom: 0.75rem;
    transition: all 0.2s ease;
}

.activity-item:hover {
    background: var(--border-light);
}

.activity-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    margin-top: 0.5rem;
    flex-shrink: 0;
}

.activity-content {
    flex: 1;
}

.activity-description {
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.activity-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Tasks List */
.task-item {
    display: flex;
    align-items: start;
    gap: 0.75rem;
    padding: 0.875rem;
    background: var(--bg-hover);
    border-radius: 8px;
    margin-bottom: 0.75rem;
    border-left: 4px solid var(--accent);
}

.task-item.priority-high {
    border-left-color: var(--danger);
}

.task-item.priority-medium {
    border-left-color: var(--accent);
}

.task-item.priority-low {
    border-left-color: var(--success);
}

.task-content {
    flex: 1;
}

.task-title {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.task-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Table */
.table-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) var(--border-light);
}

/* Custom Scrollbar for Chrome/Safari/Edge */
.table-container::-webkit-scrollbar {
    height: 8px;
}

.table-container::-webkit-scrollbar-track {
    background: var(--bg-hover);
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 4px;
    border: 2px solid var(--bg-hover);
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: var(--secondary);
}

.data-table {
    width: 100%;
    min-width: max-content;
    border-collapse: collapse;
}

.data-table thead {
    background: var(--bg-hover);
}

.data-table th {
    text-align: left;
    padding: 1rem;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--border-color);
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.875rem;
}

.data-table tbody tr {
    transition: background 0.2s ease;
}

.data-table tbody tr:hover {
    background: var(--bg-hover);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-new {
    background: #DBEAFE;
    color: #1E40AF;
}

.badge-contacted {
    background: #E9D5FF;
    color: #6B21A8;
}

.badge-qualified {
    background: #D1FAE5;
    color: #065F46;
}

.badge-converted {
    background: #FEF3C7;
    color: #92400E;
}

.badge-active {
    background: #D1FAE5;
    color: #065F46;
}

.badge-inactive {
    background: #F1F5F9;
    color: #475569;
}

.badge-admin {
    background: #FEE2E2;
    color: #991B1B;
}

.badge-manager {
    background: #FEF3C7;
    color: #92400E;
}

.badge-user {
    background: #DBEAFE;
    color: #1E40AF;
}

/* Filters */
.filters-card {
    margin-bottom: 1.5rem;
}

.filters-grid {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1rem;
}

.filters-grid-with-action {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 1rem;
    align-items: center;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.modal {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 2rem;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h2 {
    font-size: 1.75rem;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.close-btn:hover {
    background: var(--bg-hover);
}

/* Form Grid */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.form-full {
    grid-column: 1 / -1;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.5rem;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 70px;
    }
    
    .sidebar-header h2 {
        font-size: 1rem;
    }
    
    .sidebar-header p,
    .nav-item span:not(.nav-icon) {
        display: none;
    }
    
    .nav-icon {
        margin: 0 auto;
    }
    
    .main-content {
        margin-left: 70px;
        padding: 1rem;
    }
    
    .grid-2 {
        grid-template-columns: 1fr;
    }
    
    .filters-grid,
    .filters-grid-with-action {
        grid-template-columns: 1fr;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.font-bold { font-weight: 700; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }

/* Animation Enhancements */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

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

.slide-in {
    animation: slideIn 0.4s ease-out;
}

@keyframes slideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

.slide-up {
    animation: slideUp 0.3s ease-out;
}

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

/* Loading States */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(2px);
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-light);
    border-top: 2px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-spinner.lg {
    width: 40px;
    height: 40px;
    border-width: 3px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Enhanced Card Interactions */
.card.interactive {
    cursor: pointer;
}

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

/* Status Indicators */
.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 0.5rem;
}

.status-indicator.online {
    background-color: var(--success);
    box-shadow: 0 0 6px rgba(5, 150, 105, 0.4);
}

.status-indicator.offline {
    background-color: var(--danger);
}

.status-indicator.processing {
    background-color: var(--warning);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Enhanced Form Controls */
.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

.form-control.is-valid {
    border-color: var(--success);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}

.form-control.is-invalid {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

/* Accessibility Improvements */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.focus-visible {
    outline: 2px solid var(--primary) !important;
    outline-offset: 2px !important;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   SAP FIORI STYLE FORM COMPONENTS
   ============================================ */

/* SAP Page Header Bar */
.sap-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.sap-header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sap-back-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 1rem;
    background: var(--bg-card);
}

.sap-back-btn:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
    color: var(--primary);
}

.sap-header-title {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.sap-breadcrumb {
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

.sap-header-title h1 {
    font-size: 1.25rem;
    color: var(--text-primary);
    font-weight: 600;
    margin: 0;
}

.sap-header-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.sap-btn-cancel {
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1.25rem;
    font-size: 0.875rem;
    border-radius: 6px;
    width: auto;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    font-weight: 500;
}

.sap-btn-cancel:hover {
    background: var(--bg-hover);
    border-color: var(--text-secondary);
    color: var(--text-primary);
}

.sap-btn-save {
    background: var(--primary);
    color: white;
    border: 1px solid var(--primary);
    padding: 0.5rem 1.25rem;
    font-size: 0.875rem;
    border-radius: 6px;
    width: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 500;
    cursor: pointer;
}

.sap-btn-save:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.2);
}

/* SAP Section Container */
.sap-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    margin-bottom: 1rem;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s ease;
}

.sap-section:hover {
    box-shadow: var(--shadow-md);
}

/* SAP Section Header */
.sap-section-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.875rem 1.5rem;
    background: #F8FAFC;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.01em;
    border-left: 3px solid var(--primary);
}

.sap-section-header i {
    font-size: 1rem;
    color: var(--primary);
}

/* SAP Section Body */
.sap-section-body {
    padding: 1.25rem 1.5rem;
}

/* SAP Form Row - always 3 columns */
.sap-form-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-bottom: 1rem;
}

.sap-form-row:last-child {
    margin-bottom: 0;
}

/* SAP Field */
.sap-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.sap-field-full {
    grid-column: 1 / -1;
}

.sap-field-wide {
    grid-column: span 2;
}

.sap-field-empty {
    visibility: hidden;
}

/* SAP Label */
.sap-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sap-required {
    color: var(--danger);
    font-size: 0.9rem;
}

/* SAP Input */
.sap-input {
    width: 100%;
    padding: 0.55rem 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9rem;
    font-family: inherit;
    background: var(--bg-card);
    color: var(--text-primary);
    transition: all 0.2s ease;
    height: 38px;
}

.sap-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.08);
    background: #FAFBFF;
}

.sap-input:hover:not(:focus) {
    border-color: var(--text-muted);
}

select.sap-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2rem;
    cursor: pointer;
}

.sap-textarea {
    height: auto;
    min-height: 100px;
    resize: vertical;
    line-height: 1.5;
}

/* SAP Role Info Cards */
.sap-role-info {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
}

.sap-role-card {
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.875rem 1rem;
    font-size: 0.8rem;
}

.sap-role-card strong {
    display: block;
    color: var(--primary);
    margin-bottom: 0.35rem;
    font-size: 0.85rem;
    font-weight: 600;
}

.sap-role-card p {
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.4;
}

/* SAP Responsive */
@media (max-width: 900px) {
    .sap-form-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .sap-field-wide {
        grid-column: span 1;
    }

    .sap-role-info {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .sap-form-row {
        grid-template-columns: 1fr;
    }

    .sap-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .sap-header-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

/* ============================================
   LEADS LIST PAGE STYLES
   ============================================ */

/* Page Header */
.ls-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.25rem;
}

.ls-page-header-left h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ls-count-badge {
    font-size: 0.875rem;
    font-weight: 600;
    background: var(--primary);
    color: white;
    padding: 0.15rem 0.6rem;
    border-radius: 20px;
    vertical-align: middle;
}

.ls-page-header-left p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.ls-page-header-right {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.ls-btn-export {
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    border-radius: 6px;
    width: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
}

.ls-btn-export:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
    color: var(--primary);
}

.ls-btn-new {
    background: var(--primary);
    color: white;
    border: 1px solid var(--primary);
    padding: 0.5rem 1.1rem;
    font-size: 0.875rem;
    border-radius: 6px;
    width: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
}

.ls-btn-new:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.2);
}

/* Filter Card */
.ls-filter-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
}

/* SAP-style search row */
.ls-filter-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.ls-search-row {
    margin-bottom: 0; /* reset if used inside ls-filter-row */
    flex: 1;
    min-width: 300px;
}

/* SAP Search Bar */
.ls-sap-search {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-card);
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
    height: 40px;
}

.ls-sap-search:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.08);
}

.ls-sap-search-label {
    padding: 0 0.875rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: #F1F5F9;
    border-right: 1px solid var(--border-color);
    height: 100%;
    display: flex;
    align-items: center;
    white-space: nowrap;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.ls-sap-search-icon {
    padding: 0 0.75rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
}

.ls-sap-search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 0.875rem;
    font-family: inherit;
    color: var(--text-primary);
    background: transparent;
    padding: 0 0.5rem 0 0;
    height: 100%;
}

.ls-sap-search-input::placeholder {
    color: var(--text-muted);
}

.ls-sap-search-btn {
    padding: 0 1rem;
    background: var(--primary);
    color: white;
    border: none;
    height: 100%;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    letter-spacing: 0.02em;
    transition: background 0.2s;
    white-space: nowrap;
}

.ls-sap-search-btn:hover {
    background: var(--primary-dark);
}

/* Filter chips row */
.ls-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

/* Filter chip - looks like a styled button/pill */
.ls-chip {
    position: relative;
    display: inline-block;
}

/* Add/Update this in your CSS */
.ls-chip select {
    /* Browser ka default arrow hatao */
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    
    /* Styling */
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 0 2rem 0 0.875rem; /* Right padding arrow ke liye */
    font-size: 0.8rem;
    font-family: inherit;
    font-weight: 500;
    color: var(--text-primary);
    background: var(--bg-card);
    cursor: pointer;
    height: 32px;
    line-height: 30px;
    outline: none;
    width: auto;
    min-width: 130px;
}

.ls-chip select:hover {
    border-color: var(--primary);
    background: #EFF6FF;
    color: var(--primary);
}

.ls-chip select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.08);
}

/* Active filter chip - highlighted */
.ls-chip.active select {
    background: #EFF6FF;
    border-color: var(--primary);
    color: var(--primary);
    font-weight: 600;
}

/* Ensure the arrow is actually visible since you commented it out earlier */
.ls-chip-arrow {
    position: absolute;
    right: 0.8rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none; /* Taaki click select par hi jaye */
    color: var(--text-muted);
    font-size: 0.65rem;
    z-index: 2;
}
.ls-chip.active .ls-chip-arrow {
    color: var(--primary);
}

/* Clear filter button */
.ls-chip-clear {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    border: 1px dashed var(--danger);
    border-radius: 20px;
    padding: 0.35rem 0.875rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--danger);
    background: transparent;
    cursor: pointer;
    text-decoration: none;
    height: 32px;
    transition: all 0.2s;
}

.ls-chip-clear:hover {
    background: #FEE2E2;
}

/* Active filter count indicator */
.ls-filter-active-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: 50%;
    margin-left: 0.25rem;
    vertical-align: middle;
}

/* Bulk Action Bar */
.ls-bulk-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: #EFF6FF;
    border: 1px solid #BFDBFE;
    border-radius: 8px;
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
}

.ls-bulk-count {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary);
    white-space: nowrap;
}

.ls-bulk-actions {
    display: flex;
    gap: 0.625rem;
    align-items: center;
    flex-wrap: wrap;
}

.ls-bulk-btn {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 0.4rem 0.875rem;
    font-size: 0.8rem;
    border-radius: 6px;
    width: auto;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 500;
}

.ls-bulk-btn:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
    color: var(--primary);
}

.ls-bulk-delete {
    color: var(--danger);
    border-color: var(--danger);
}

.ls-bulk-delete:hover {
    background: #FEE2E2;
    border-color: var(--danger);
    color: var(--danger);
}

.ls-bulk-status-wrap {
    display: flex;
    gap: 0.4rem;
    align-items: center;
}

/* Table */
.ls-table-card {
    padding: 0;
    overflow: hidden;
}

.table-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.ls-table {
    width: 100%;
    min-width: max-content;
    table-layout: auto;
}

.ls-table thead th {
    font-size: 0.75rem;
    padding: 0.875rem 0.875rem;
    white-space: nowrap;
}

.ls-table td {
    padding: 0.875rem 0.875rem;
    font-size: 0.875rem;
    vertical-align: middle;
}

.ls-th-check, .ls-td-check {
    width: 40px;
    text-align: center;
}

.ls-th-actions {
    text-align: center;
}

.ls-td-email {
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Checkbox */
.ls-checkbox {
    width: 15px;
    height: 15px;
    accent-color: var(--primary);
    cursor: pointer;
}

/* Sort links */
.ls-sort-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: color 0.15s;
}

.ls-sort-link:hover {
    color: var(--primary);
}

.ls-sort-active {
    color: var(--primary);
}

.ls-sort-idle {
    opacity: 0.3;
}

/* Lead Score */
.ls-score {
    display: inline-block;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
}

.ls-score-high { background: #D1FAE5; color: #065F46; }
.ls-score-mid  { background: #FEF3C7; color: #92400E; }
.ls-score-low  { background: #F1F5F9; color: #475569; }

/* Empty state */
.ls-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.ls-empty i {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 0.75rem;
    opacity: 0.4;
}

.ls-empty p {
    font-size: 0.9rem;
}

/* Row hover */
.ls-row:hover {
    background: #F8FAFF;
}

/* Pagination */
.ls-pagination {
    display: flex;
    justify-content: center; /* Centered as requested */
    align-items: center;
    margin-top: 1.25rem;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.ls-page-info {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.ls-page-btns {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.ls-page-btn {
    min-width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    background: var(--bg-card);
    transition: all 0.2s;
    padding: 0 0.75rem;
    cursor: pointer;
}

.ls-page-btn:hover:not(.disabled):not(.ls-page-active) {
    border-color: var(--primary);
    color: var(--primary);
    background: #EFF6FF;
    transform: translateY(-1px);
}

.ls-page-active {
    background: var(--primary) !important;
    color: white !important;
    border-color: var(--primary) !important;
    font-weight: 600;
    cursor: default;
    box-shadow: 0 2px 4px rgba(30, 64, 175, 0.2);
}

.ls-page-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: var(--bg-hover);
    pointer-events: none;
}

.ls-page-ellipsis {
    color: var(--text-muted);
    font-size: 0.8rem;
    padding: 0 0.25rem;
}

/* Responsive */
@media (max-width: 1024px) {
    .ls-filter-chips { gap: 0.4rem; }
    .ls-table { font-size: 0.8rem; }
}

@media (max-width: 768px) {
    .main-content {
        margin-left: 70px;
        max-width: calc(100vw - 70px);
        padding: 1rem;
    }
    .ls-page-header { flex-direction: column; gap: 0.75rem; }
    .ls-filter-chips { flex-direction: column; align-items: stretch; }
    .ls-chip select { width: 100%; }
    .ls-bulk-bar { flex-direction: column; align-items: flex-start; }
    .ls-sap-search { flex-wrap: wrap; height: auto; }
    .ls-sap-search-label { display: none; }
}

/* ============================================
   LEAD DETAIL PAGE STYLES
   ============================================ */

/* Lead name link in table */
.ld-name-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.ld-name-link:hover {
    text-decoration: underline;
}

/* Header Card */
.ld-header-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.75rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.ld-header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.25rem;
}

.ld-header-left {
    display: flex;
    gap: 1rem;
    flex: 1;
}

.ld-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ld-avatar i {
    font-size: 2.5rem;
    color: var(--primary);
}

.ld-header-info h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.ld-header-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.ld-header-meta i {
    margin-right: 0.25rem;
}

.ld-divider {
    color: var(--border-color);
}

.ld-header-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.ld-badge-source {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    background: #F1F5F9;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.ld-score-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.ld-score-badge.high { background: #D1FAE5; color: #065F46; }
.ld-score-badge.mid  { background: #FEF3C7; color: #92400E; }
.ld-score-badge.low  { background: #F1F5F9; color: #475569; }

.ld-header-actions {
    display: flex;
    gap: 0.5rem;
}

.ld-btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    border-radius: 6px;
    width: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 500;
    text-decoration: none;
}

.ld-btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
    color: var(--primary);
}

/* Quick Actions Bar */
.ld-quick-actions {
    display: flex;
    gap: 0.75rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-light);
}

.ld-action-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    padding: 0.875rem 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-card);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.ld-action-btn i {
    font-size: 1.25rem;
    color: var(--primary);
}

.ld-action-btn:hover {
    background: #EFF6FF;
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.ld-action-convert {
    background: linear-gradient(135deg, #ECFDF5 0%, #D1FAE5 100%);
    border-color: var(--success);
}

.ld-action-convert i {
    color: var(--success);
}

.ld-action-convert:hover {
    background: var(--success);
    color: white;
}

.ld-action-convert:hover i {
    color: white;
}

/* Three Column Layout */
.ld-three-col {
    display: grid;
    grid-template-columns: 280px 1fr 320px;
    gap: 1.5rem;
}

/* Sidebar Cards */
.ld-sidebar-left, .ld-sidebar-right {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.ld-info-card h3,
.ld-notes-card h3,
.ld-tasks-card h3,
.ld-tags-card h3,
.ld-timeline-card h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    color: var(--text-primary);
}

.ld-info-card h3 i,
.ld-notes-card h3 i,
.ld-tasks-card h3 i,
.ld-tags-card h3 i,
.ld-timeline-card h3 i {
    font-size: 1.1rem;
    color: var(--primary);
}

/* Contact Info */
.ld-info-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ld-info-item {
    display: flex;
    gap: 0.75rem;
}

.ld-info-item > i {
    width: 20px;
    font-size: 1rem;
    color: var(--primary);
    flex-shrink: 0;
    margin-top: 0.15rem;
}

.ld-info-item > div {
    flex: 1;
    min-width: 0;
}

.ld-info-item label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.2rem;
}

.ld-info-item span,
.ld-info-item a {
    display: block;
    font-size: 0.875rem;
    color: var(--text-primary);
    word-break: break-word;
}

.ld-info-item a {
    color: var(--primary);
    text-decoration: none;
}

.ld-info-item a:hover {
    text-decoration: underline;
}

/* Tags */
.ld-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.ld-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.ld-tag.tag-red {
    background: #FEE2E2;
    color: #991B1B;
}

.ld-tag.tag-blue {
    background: #DBEAFE;
    color: #1E3A8A;
}

/* Activity Timeline */
.ld-timeline {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ld-timeline-item {
    display: flex;
    gap: 1rem;
    position: relative;
}

.ld-timeline-item:not(:last-child)::before {
    content: '';
    position: absolute;
    left: 9px;
    top: 28px;
    bottom: -16px;
    width: 2px;
    background: var(--border-light);
}

.ld-timeline-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary);
    border: 3px solid #EFF6FF;
    flex-shrink: 0;
    margin-top: 2px;
}

.ld-timeline-content {
    flex: 1;
}

.ld-timeline-header {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
    margin-bottom: 0.25rem;
}

.ld-timeline-icon {
    color: var(--primary);
    font-size: 1rem;
}

.ld-timeline-desc {
    font-size: 0.875rem;
    color: var(--text-primary);
    line-height: 1.5;
}

.ld-timeline-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Notes & Tasks */
.ld-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.ld-card-header h3 {
    margin-bottom: 0;
}

.ld-note-form,
.ld-task-form {
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--bg-hover);
    border-radius: 8px;
}

.ld-note-textarea {
    width: 100%;
    min-height: 80px;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.875rem;
    resize: vertical;
    margin-bottom: 0.75rem;
}

.ld-note-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.08);
}

.ld-note-actions {
    display: flex;
    gap: 0.5rem;
}

.ld-notes-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ld-note {
    padding: 0.875rem;
    background: var(--bg-hover);
    border-radius: 8px;
    border-left: 3px solid var(--primary);
}

.ld-note-text {
    font-size: 0.875rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.ld-note-meta {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.ld-tasks-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ld-task {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem;
    background: var(--bg-hover);
    border-radius: 8px;
    border-left: 3px solid var(--primary);
}

.ld-task-content {
    flex: 1;
}

.ld-task-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.ld-task-due {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Empty States */
.ld-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-muted);
}

.ld-empty i {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.5rem;
    opacity: 0.4;
}

.ld-empty p {
    font-size: 0.875rem;
}

.ld-empty-sm {
    text-align: center;
    padding: 1.5rem 1rem;
    color: var(--text-muted);
}

.ld-empty-sm i {
    font-size: 1.5rem;
    display: block;
    margin-bottom: 0.35rem;
    opacity: 0.4;
}

.ld-empty-sm p {
    font-size: 0.8rem;
}

/* Responsive */
@media (max-width: 1200px) {
    .ld-three-col {
        grid-template-columns: 260px 1fr;
    }
    
    .ld-sidebar-right {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .ld-three-col {
        grid-template-columns: 1fr;
    }
    
    .ld-sidebar-right {
        grid-template-columns: 1fr;
    }
    
    .ld-header-top {
        flex-direction: column;
        gap: 1rem;
    }
    
    .ld-quick-actions {
        flex-wrap: wrap;
    }
    
    .ld-action-btn {
        min-width: calc(50% - 0.375rem);
    }
}

/* ============================================
   PROJECT DETAIL PAGE STYLES
   ============================================ */

/* Two Column Layout for Projects */
.pd-two-col {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 1.5rem;
}
.pd-two-col > * {
    min-width: 0;
}

/* Project Description Card */
.pd-desc-card {
    margin-top: 1.5rem;
}

.pd-description {
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--text-primary);
    white-space: pre-wrap;
}

/* Notes Card */
.pd-notes-card h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.pd-notes-card h3 i {
    font-size: 1.1rem;
    color: var(--primary);
}

/* Notes Table */
.pd-notes-table {
    margin-top: 1rem;
    width: 100%;
    table-layout: fixed;
}

.pd-notes-table td {
    vertical-align: top;
    padding: 0.75rem 0.875rem;
}

.pd-notes-table thead th {
    padding: 0.75rem 0.875rem;
}

.pd-note-author-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.pd-note-author-cell i {
    font-size: 1.2rem;
    color: var(--primary);
}

.pd-note-content-cell {
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--text-primary);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.pd-note-date-cell {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    font-size: 0.875rem;
}

.pd-note-exact-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Notes Pagination */
.pd-notes-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
    flex-wrap: wrap;
    gap: 0.75rem;
}

.pd-page-info {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.pd-page-btns {
    display: flex;
    gap: 0.3rem;
    align-items: center;
}

/* Responsive */
@media (max-width: 900px) {
    .pd-two-col {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   DEALS PIPELINE STYLES
   ============================================ */

/* Pipeline Page Header */
.dp-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.dp-header-left h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.dp-header-left p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.dp-header-stats {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.dp-stat {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.dp-stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.dp-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.dp-header-actions {
    display: flex;
    gap: 0.75rem;
}

/* Pipeline Kanban Board */
.dp-pipeline {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
}

/* Pipeline Stage Column */
.dp-stage {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.dp-stage-header {
    padding: 0.75rem 0.875rem;
    border-radius: 8px 8px 0 0;
    margin-bottom: 0.5rem;
}

.stage-discovery { background: linear-gradient(135deg, #F0F9FF 0%, #E0F2FE 100%); }
.stage-demo { background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 100%); }
.stage-proposal { background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%); }
.stage-negotiation { background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%); }
.stage-won { background: linear-gradient(135deg, #D1FAE5 0%, #A7F3D0 100%); }
.stage-lost { background: linear-gradient(135deg, #FEE2E2 0%, #FECACA 100%); }

.dp-stage-title {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
}

.dp-stage-title i {
    font-size: 0.9rem;
    color: var(--primary);
}

.dp-stage-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.dp-stage-count {
    font-weight: 600;
}

.dp-stage-value {
    font-weight: 600;
}

/* Deal Cards in Pipeline */
.dp-stage-deals {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    min-height: 200px;
    overflow-y: auto;
    max-height: calc(100vh - 300px);
}

.dp-deal-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.dp-deal-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--primary);
}

.dp-deal-won {
    border-left: 3px solid var(--success);
}

.dp-deal-lost {
    border-left: 3px solid var(--danger);
    opacity: 0.7;
}

.dp-deal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.625rem;
}

.dp-deal-header h4 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    word-break: break-word;
}

.dp-deal-value {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--primary);
    white-space: nowrap;
    flex-shrink: 0;
}

.dp-deal-value-lg {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
}

.dp-deal-meta {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin-bottom: 0.625rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.dp-deal-meta span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dp-deal-meta i {
    margin-right: 0.25rem;
}

.dp-deal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.625rem;
    border-top: 1px solid var(--border-light);
    gap: 0.5rem;
}

.dp-deal-close-date {
    font-size: 0.7rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.dp-deal-probability {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.4rem;
    background: var(--bg-hover);
    border-radius: 4px;
    color: var(--text-primary);
    white-space: nowrap;
    flex-shrink: 0;
}

/* Badge colors for deal stages */
.badge-discovery { background: #DBEAFE; color: #1E3A8A; }
.badge-demo { background: #E0E7FF; color: #3730A3; }
.badge-proposal { background: #E9D5FF; color: #6B21A8; }
.badge-negotiation { background: #FDE68A; color: #92400E; }
.badge-won { background: #A7F3D0; color: #065F46; }
.badge-lost { background: #FECACA; color: #991B1B; }

/* Responsive Pipeline */
@media (max-width: 1400px) {
    .dp-pipeline {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.625rem;
    }
    
    .dp-stage:nth-child(n+4) {
        margin-top: 1rem;
    }
}

@media (max-width: 900px) {
    .dp-pipeline {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .dp-page-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .dp-header-stats {
        width: 100%;
        justify-content: space-between;
    }
    
    .dp-stat {
        text-align: center;
    }
    
    .dp-pipeline {
        grid-template-columns: 1fr;
    }
}
.status-active {
    color: var(--success);
}

.status-planning {
    color: var(--warning);
}

.status-completed {
    color: var(--primary);
}

.status-on-hold,
.status-cancelled {
    color: var(--text-muted);
}
.project-website-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    color: var(--primary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.2s;
    max-width: 200px;
}

.project-website-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.project-website-link i {
    font-size: 1rem;
    flex-shrink: 0;
}

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

/* Website column in table */
.data-table th:nth-child(7),
.data-table td:nth-child(7) {
    min-width: 160px;
    max-width: 200px;
}

/* Empty website state */
.website-empty {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Responsive: use scrollbar on smaller screens instead of hiding columns */

/* Notes Card with Table */
.ld-notes-card-table {
    padding: 0 !important;
}

.ld-notes-card-table .ld-card-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

/* Compact Note Form */
.ld-note-form-compact {
    padding: 1rem;
    background: #F9FAFB;
    border-bottom: 1px solid var(--border-color);
}

.ld-note-textarea-compact {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #D1D5DB;
    border-radius: 4px;
    font-size: 0.875rem;
    font-family: inherit;
    resize: vertical;
    margin-bottom: 0.75rem;
}

.ld-note-textarea-compact:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.ld-note-actions-compact {
    display: flex;
    gap: 0.5rem;
}

/* Notes Table */
.ld-notes-table-container {
    overflow-x: auto;
}

.ld-notes-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.ld-notes-table thead {
    background: #F9FAFB;
    border-bottom: 2px solid #E5E7EB;
}

.ld-notes-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ld-notes-table tbody tr {
    border-bottom: 1px solid #E5E7EB;
    transition: background-color 0.15s;
}

.ld-notes-table tbody tr:hover {
    background: #F9FAFB;
}

.ld-notes-table td {
    padding: 0.875rem 1rem;
    vertical-align: top;
}

.ld-note-content {
    color: #1F2937;
    line-height: 1.5;
    max-width: none;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.ld-note-author {
    color: #6B7280;
    white-space: nowrap;
    min-width: 120px;
}

.ld-note-date {
    color: #9CA3AF;
    white-space: nowrap;
    min-width: 100px;
    font-size: 0.8125rem;
}

/* Notes Pagination */
.ld-notes-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-top: 1px solid #E5E7EB;
    background: #F9FAFB;
}

.ld-notes-page-info {
    font-size: 0.875rem;
    color: #6B7280;
}

.ld-notes-page-btns {
    display: flex;
    gap: 0.25rem;
}

.ld-page-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    padding: 0 0.5rem;
    border: 1px solid #D1D5DB;
    border-radius: 4px;
    background: white;
    color: #374151;
    font-size: 0.875rem;
    text-decoration: none;
    transition: all 0.15s;
}

.ld-page-btn:hover {
    background: #F3F4F6;
    border-color: #9CA3AF;
}

.ld-page-btn.ld-page-active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    font-weight: 600;
}

.ld-page-ellipsis {
    display: flex;
    align-items: center;
    padding: 0 0.25rem;
    color: #9CA3AF;
}

/* Empty state for notes table */
.ld-notes-card-table .ld-empty-sm {
    padding: 3rem 1rem;
    text-align: center;
    color: var(--text-muted);
}

.ld-notes-card-table .ld-empty-sm i {
    font-size: 2rem;
    color: #D1D5DB;
    display: block;
    margin-bottom: 0.5rem;
}

.ld-notes-card-table .ld-empty-sm p {
    font-size: 0.875rem;
    margin: 0.5rem 0;
}

.ld-empty-sub {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Three column layout */
.ld-three-col {
    display: grid;
    grid-template-columns: 280px 1fr 320px;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

/* Timeline in right sidebar - make scrollable */
.ld-sidebar-right .ld-timeline {
    max-height: 600px;
    overflow-y: auto;
}

/* Responsive */
@media (max-width: 1200px) {
    .ld-three-col {
        grid-template-columns: 1fr;
    }
}
.ls-table {
    table-layout: auto; /* Changed from fixed to auto */
    width: 100%;
    min-width: max-content;
}

/* Keep action icons at proper size */
.action-buttons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    justify-content: flex-start;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.btn-icon i {
    font-size: 1.125rem; /* Keep icon size consistent */
}

.btn-icon:hover {
    color: var(--primary);
    background: var(--bg-light);
    border-radius: 4px;
}

/* Optimize specific columns without shrinking everything */
.ls-table td.ls-td-email {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ls-table th:last-child,
.ls-table td:last-child {
    width: 200px; /* Fixed width for actions to prevent shrinking */
    min-width: 200px;
}

/* Removed responsive rules that hide critical columns - using scrollbar instead */

/* Responsive: all columns visible with scrollbar */

/* Deal card wrapper - make it relative for absolute positioning of actions */
.dp-deal-card {
    position: relative;
    background: white;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
}
 
/* Clickable area - most of the card */
.dp-deal-card-clickable {
    cursor: pointer;
}
 
.dp-deal-card-clickable:hover {
    opacity: 0.95;
}
 
/* Action buttons container - positioned at top right */
.dp-deal-actions {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 10;
}
 
/* Show actions on hover */
.dp-deal-card:hover .dp-deal-actions {
    opacity: 1;
}
 
/* Individual action buttons */
.dp-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    background: white;
    color: #6B7280;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    font-size: 14px;
    text-decoration: none;
}
 
.dp-action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
}
 
/* Edit button */
.dp-edit-btn {
    background: #2B5FB8;
    color: white;
}
 
.dp-edit-btn:hover {
    background: #1E4A99;
}
 
/* Delete button */
.dp-delete-btn {
    background: #EF4444;
    color: white;
}
 
.dp-delete-btn:hover {
    background: #DC2626;
}
 
/* Danger button for deal detail page */
.btn-danger {
    background-color: #EF4444;
    color: white;
    border: none;
}
 
.btn-danger:hover {
    background-color: #DC2626;
}
 
/* Make sure card hover doesn't affect action buttons */
.dp-deal-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
}
 
/* Prevent card click when clicking actions */
.dp-deal-actions * {
    pointer-events: auto;
}
/* Hint text below form fields */
.sap-hint {
    display: block;
    margin-top: 4px;
    font-size: 0.8rem;
    color: #6B7280;
    font-style: italic;
}
 
/* Make placeholder text more visible */
.sap-input::placeholder {
    color: #9CA3AF;
    opacity: 1;
}
 
/* Optional: Style for optional field labels */
.sap-label-optional::after {
    content: " (optional)";
    color: #6B7280;
    font-weight: normal;
    font-size: 0.85em;
}

.app-container {
    display: flex;
    min-height: 100vh;
    background: #f9fafb;
}
 
/* Sidebar - Keep existing styles */
.sidebar {
    width: 250px;
    background: #fff;
    border-right: 1px solid #e5e7eb;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 50;
}
 
/* =====================================================
   MAIN WRAPPER - Account for sidebar width
   ===================================================== */
 
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin-left: 250px; /* Match sidebar width */
    width: calc(100% - 250px); /* Important: Calculate remaining width */
}
 
/* =====================================================
   TOP NAVIGATION BAR
   ===================================================== */
 
.top-nav {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    height: 64px;
    display: flex;
    align-items: center;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 40;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
 
.top-nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}
 
.top-nav-left {
    flex: 1;
}
 
.page-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
}
 
.top-nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}
 
/* =====================================================
   MAIN CONTENT AREA
   ===================================================== */
 
.main-content {
    flex: 1;
    padding: 2rem;
    background: #f9fafb;
    width: 100%;
    max-width: 100%; /* Prevent overflow */
    box-sizing: border-box; /* Include padding in width calculation */
}
 
/* =====================================================
   USER MENU & AVATAR
   ===================================================== */
 
.user-menu {
    position: relative;
}
 
.user-avatar-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}
 
.user-avatar-btn:hover {
    background: #f9fafb;
    border-color: #e5e7eb;
}
 
.user-avatar-btn:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
 
.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
 
.user-initial {
    color: #fff;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
}
 
.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
}
 
.user-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: #111827;
    line-height: 1.2;
}
 
.user-role {
    font-size: 0.75rem;
    color: #6b7280;
    line-height: 1.2;
}
 
.user-chevron {
    color: #9ca3af;
    font-size: 0.75rem;
    transition: transform 0.2s ease;
}
 
.user-avatar-btn[aria-expanded="true"] .user-chevron {
    transform: rotate(180deg);
}
 
/* =====================================================
   USER DROPDOWN MENU
   ===================================================== */
 
.user-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    width: 280px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
}
 
.user-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
 
.user-dropdown-header {
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}
 
.user-avatar-large {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
 
.user-initial-large {
    color: #fff;
    font-size: 1.125rem;
    font-weight: 600;
    text-transform: uppercase;
}
 
.user-dropdown-info {
    flex: 1;
    min-width: 0;
}
 
.user-dropdown-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
 
.user-dropdown-email {
    font-size: 0.75rem;
    color: #6b7280;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
 
.user-dropdown-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 0.5rem 0;
}
 
.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    color: #374151;
    text-decoration: none;
    transition: all 0.15s ease;
    font-size: 0.875rem;
}
 
.user-dropdown-item:hover {
    background: #f9fafb;
    color: #111827;
}
 
.user-dropdown-item i {
    font-size: 1rem;
    color: #6b7280;
}
 
.user-dropdown-item:hover i {
    color: #3b82f6;
}
 
.user-dropdown-logout {
    color: #dc2626;
}
 
.user-dropdown-logout:hover {
    background: #fef2f2;
    color: #dc2626;
}
 
.user-dropdown-logout i {
    color: #dc2626;
}
 
/* =====================================================
   PROFILE PAGE STYLES
   ===================================================== */
 
.profile-header-card {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    width: 100%;
    box-sizing: border-box;
}
 
.profile-header-content {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}
 
.profile-avatar-large {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 3px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
 
.profile-initial {
    color: #fff;
    font-size: 2.5rem;
    font-weight: 700;
    text-transform: uppercase;
}
 
.profile-header-info h1 {
    color: #fff;
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
}
 
.profile-role {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
 
.profile-role i {
    font-size: 1.125rem;
}
 
/* Profile Content Container */
 
.profile-content {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}
 
.profile-section {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    width: 100%;
    box-sizing: border-box;
}
 
.profile-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}
 
.profile-section-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
 
.profile-section-header i {
    color: #3b82f6;
}
 
/* Profile Info Grid */
 
.profile-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    width: 100%;
}
 
.profile-info-item label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}
 
.profile-info-item p {
    font-size: 0.9375rem;
    color: #111827;
    margin: 0;
    word-break: break-word; /* Prevent overflow */
}
 
.profile-info-item a {
    color: #3b82f6;
    text-decoration: none;
    word-break: break-all; /* Handle long emails */
}
 
.profile-info-item a:hover {
    text-decoration: underline;
}
 
/* Profile Settings */
 
.profile-settings {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
 
.profile-setting-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.15s ease;
    cursor: pointer;
}
 
.profile-setting-item:hover {
    border-color: #3b82f6;
    background: #f9fafb;
}
 
.profile-setting-item.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
 
.profile-setting-item.disabled:hover {
    border-color: #e5e7eb;
    background: transparent;
}
 
.profile-setting-icon {
    width: 48px;
    height: 48px;
    background: #f3f4f6;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
 
.profile-setting-icon i {
    font-size: 1.25rem;
    color: #3b82f6;
}
 
.profile-setting-content {
    flex: 1;
}
 
.profile-setting-content h3 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 0.25rem;
}
 
.profile-setting-content p {
    font-size: 0.8125rem;
    color: #6b7280;
    margin: 0;
}
 
.profile-setting-item > .bi-chevron-right {
    color: #9ca3af;
    font-size: 1rem;
}
 
/* Badge Styles for Profile */
 
.badge-admin {
    background: #7c3aed;
    color: #fff;
}
 
.badge-manager {
    background: #3b82f6;
    color: #fff;
}
 
.badge-user {
    background: #10b981;
    color: #fff;
}
 
.badge-active {
    background: #dcfce7;
    color: #166534;
}
 
.badge-inactive {
    background: #fee2e2;
    color: #991b1b;
}
 
/* =====================================================
   RESPONSIVE DESIGN
   ===================================================== */
 
@media (max-width: 1024px) {
    .main-wrapper {
        margin-left: 250px;
        width: calc(100% - 250px);
    }
}
 
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    
    .main-wrapper {
        margin-left: 0;
        width: 100%;
    }
    
    .top-nav {
        padding: 0 1rem;
    }
    
    .page-title {
        font-size: 1.25rem;
    }
    
    .user-info {
        display: none;
    }
    
    .user-chevron {
        display: none;
    }
    
    .user-dropdown {
        width: 260px;
    }
    
    .main-content {
        padding: 1.5rem;
    }
    
    .profile-header-card {
        padding: 1.5rem;
    }
    
    .profile-header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .profile-header-info h1 {
        font-size: 1.5rem;
    }
    
    .profile-info-grid {
        grid-template-columns: 1fr;
    }
}
 
@media (max-width: 480px) {
    .main-content {
        padding: 1rem;
    }
    
    .profile-avatar-large {
        width: 72px;
        height: 72px;
    }
    
    .profile-initial {
        font-size: 2rem;
    }
    
    .profile-section {
        padding: 1rem;
    }
}
/* Force proper layout */
.app-container {
    display: flex !important;
    min-height: 100vh !important;
}
 
/* Sidebar - fixed position */
.sidebar {
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    bottom: 0 !important;
    width: 250px !important;
    z-index: 50 !important;
}
 
/* Main wrapper - account for sidebar */
.main-wrapper {
    margin-left: 250px !important;
    width: calc(100% - 250px) !important;
    min-height: 100vh !important;
    display: flex !important;
    flex-direction: column !important;
}
 
/* Main content - full width within wrapper */
.main-content {
    width: 100% !important;
    max-width: 100% !important;
    padding: 2rem !important;
    box-sizing: border-box !important;
}
 
/* Profile sections - full width */
.profile-header-card,
.profile-section,
.profile-content {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}
 
/* Ensure fade-in doesn't add extra width */
.fade-in {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}
 
/* Profile info grid - proper sizing */
.profile-info-grid {
    width: 100% !important;
    box-sizing: border-box !important;
}
 
/* Top nav - full width of wrapper */
.top-nav {
    width: 100% !important;
    box-sizing: border-box !important;
}
 
/* Mobile responsive */
@media (max-width: 768px) {
    .main-wrapper {
        margin-left: 0 !important;
        width: 100% !important;
    }
    
    .sidebar {
        transform: translateX(-100%) !important;
    }
}

/* ===== FILTER CARD (Customers Style) ===== */
.card.p-3 {
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: #fff;
}

/* ===== SEARCH ROW ===== */
#searchInput {
    height: 40px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    font-size: 14px;
}

#searchInput:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

/* ===== FILTER DROPDOWNS ===== */
.form-select.w-auto {
    height: 38px;
    padding: 4px 30px 4px 12px;
    border-radius: 20px;   /* pill shape */
    border: 1px solid #d1d5db;
    font-size: 13px;
    background-color: #f9fafb;
    cursor: pointer;
}

.form-select.w-auto:focus {
    border-color: #2563eb;
    box-shadow: none;
}

/* ===== FLEX ALIGN FIX ===== */
.card .d-flex {
    align-items: center;
}

/* ===== GAP FIX ===== */
.card .d-flex.flex-wrap {
    gap: 10px;
}

/* ===== BUTTON (same blue as Customers) ===== */
.btn-primary {
    background-color: #2563eb !important;
    border: none !important;
    border-radius: 8px;
    padding: 8px 16px;
}

.btn-primary:hover {
    background-color: #1d4ed8 !important;
}

.ls-page-header-right .ls-btn-new {
    width: auto !important;
}

/* ACTION COLUMN SPACING */
.ls-th-actions {
    text-align: center;
    padding-right: 20px;
}

/* TD ALIGN */
.ls-actions {
    text-align: right;       /* 👈 shift right */
    padding-right: 20px;     /* 👈 space from edge */
}

/* BUTTON GROUP */
.ls-action-group {
    display: flex;
    justify-content: flex-end;  /* 👈 push to right */
    align-items: center;
    gap: 8px;
}

.pagination-wrapper {
        display: flex;
        justify-content: flex-end; /* Aligns to bottom right as requested */
        padding: 1rem;
    }

.pagination-list {
        display: flex;
        list-style: none;
        gap: 8px;
        padding: 0;
        margin: 0;
    }

.page-link {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        border: 1px solid #e2e8f0;
        border-radius: 6px;
        background-color: #ffffff;
        color: #4a5568;
        text-decoration: none;
        font-size: 14px;
        transition: all 0.2s ease;
    }

.page-link:hover:not(.disabled):not(.active) {
        background-color: #f7fafc;
        border-color: #cbd5e0;
    }

.page-link.active {
        background-color: #ffffff;
        border-color: #3182ce; /* Matching the blue in your UI */
        color: #3182ce;
        font-weight: 600;
    }

.page-link.disabled {
        color: #cbd5e0;
        cursor: not-allowed;
        background-color: #fdfdfd;
    }

.shadow-sm {
        box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    }
.sidebar-copyright p{
    color: #000; /* black */
}
.ls-brand-color{
    color: #0b3d91; /* dark blue */
    font-weight: 600;
}
input[type="date"] {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    background: var(--bg-card);
    color: var(--text-primary);
    transition: all 0.2s ease;
}
 
input[type="date"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
 
/* Payment status badges — class names match the DB values directly
   (badge-paid, badge-unpaid, badge-free, badge-issued, badge-not_issued)
   so templates can just do class="badge badge-{{ value }}" */
.badge-paid {
    background: #D1FAE5;
    color: #065F46;
}
 
.badge-unpaid {
    background: #FEE2E2;
    color: #991B1B;
}
 
.badge-free {
    background: #F1F5F9;
    color: #475569;
}
 
.badge-issued {
    background: #D1FAE5;
    color: #065F46;
}
 
.badge-not_issued {
    background: #FEF3C7;
    color: #92400E;
}
 
/* Small stat cards inside a card (payment summary), matching the compact
   variant already used inline in customers.html's summary row */
.ld-payment-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.25rem;
}
 
.ld-payment-stat {
    background: linear-gradient(135deg, var(--bg-card) 0%, #F8FAFC 100%);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1rem 1.25rem;
}
 
.ld-payment-stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    margin-bottom: 0.35rem;
}
 
.ld-payment-stat-value {
    font-size: 1.75rem;
    font-weight: 700;
}
#payment-edit-form .form-actions .btn {
    width: auto;
    min-width: 110px;
}
