/* =========================================
   1. CORE VARIABLES & SETUP
   ========================================= */
:root {
    /* Base Colors */
    --primary: #4f46e5;       /* Indigo 600 */
    --primary-hover: #4338ca;
    --primary-soft: #eef2ff;
    
    /* Backgrounds */
    --bg-body: #f3f4f6;       /* Slate 100 */
    --bg-surface: #ffffff;
    
    /* Gradients (NEW) */
    --sidebar-gradient: linear-gradient(180deg, #0f172a 0%, #1e1b4b 100%); /* Slate 900 -> Deep Indigo */
    --brand-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);   /* Indigo -> Purple */
    --active-gradient: linear-gradient(90deg, rgba(79, 70, 229, 0.85) 0%, rgba(79, 70, 229, 0.4) 100%);
    --btn-gradient: linear-gradient(135deg, #4f46e5 0%, #3730a3 100%);
    
    /* Text */
    --text-main: #1e293b;     /* Slate 800 */
    --text-muted: #64748b;    /* Slate 500 */
    --text-light: #94a3b8;    /* Slate 400 */
    
    /* UI Details */
    --border-color: #e2e8f0;
    --radius: 12px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    
    --sidebar-width: 260px;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    font-size: 0.95rem;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--text-main);
    font-weight: 700;
    letter-spacing: -0.025em;
}

/* =========================================
   2. SIDEBAR STYLING (Premium Gradients)
   ========================================= */
#wrapper {
    display: flex;
    width: 100%;
    transition: all 0.3s ease;
}

#sidebar-wrapper {
    min-height: 100vh;
    width: var(--sidebar-width);
    margin-left: 0; 
    
    /* GRADIENT BACKGROUND */
    background: var(--sidebar-gradient); 
    
    color: white;
    transition: margin 0.3s ease-in-out;
    position: fixed; 
    z-index: 1000;
    box-shadow: 4px 0 24px rgba(0,0,0,0.15); /* Stronger shadow for depth */
    border-right: 1px solid rgba(255,255,255,0.05);
}

/* Branding Area */
.sidebar-heading {
    padding: 1.8rem 1.5rem; /* More breathing room */
    font-size: 1.25rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.brand-logo {
    width: 36px;
    height: 36px;
    
    /* LOGO GRADIENT */
    background: var(--brand-gradient);
    
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-size: 20px;
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.4); /* Glowing effect */
}

.brand-text {
    letter-spacing: 0.5px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Sidebar Links */
.list-group-flush {
    padding: 0 1rem;
    margin-top: 1.5rem;
}

.sidebar-divider {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-light);
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    padding-left: 1rem;
    letter-spacing: 0.05em;
    opacity: 0.6;
}

.list-group-item {
    background: transparent;
    color: var(--text-light);
    border: none;
    padding: 0.85rem 1rem;
    font-weight: 500;
    border-radius: var(--radius);
    margin-bottom: 4px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.list-group-item i {
    font-size: 1.15rem;
    margin-right: 12px;
    width: 24px;
    text-align: center;
    transition: transform 0.2s;
    opacity: 0.8;
}

/* Hover State */
.list-group-item:hover {
    background-color: rgba(255,255,255,0.08);
    color: #fff;
}
.list-group-item:hover i {
    transform: translateX(3px);
    opacity: 1;
}

/* Active State (Gradient) */
.list-group-item.active {
    /* GRADIENT ACTIVE STATE */
    background: var(--active-gradient) !important;
    
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border-left: 3px solid #a5b4fc; /* Accent border */
}
.list-group-item.active i {
    opacity: 1;
}

/* Logout specific */
.list-group-item.text-danger {
    color: #f87171 !important; /* Lighter red for dark background */
}
.list-group-item.text-danger:hover {
    background: rgba(239, 68, 68, 0.15) !important;
}

/* =========================================
   3. TOGGLE LOGIC & MOBILE
   ========================================= */

#page-content-wrapper {
    width: 100%;
    margin-left: var(--sidebar-width);
    transition: margin 0.3s ease-in-out;
    min-height: 100vh;
}

body.sb-sidenav-toggled #sidebar-wrapper {
    margin-left: -260px;
}
body.sb-sidenav-toggled #page-content-wrapper {
    margin-left: 0;
}

@media (max-width: 768px) {
    #sidebar-wrapper { margin-left: -260px; }
    #page-content-wrapper { margin-left: 0; }
    body.sb-sidenav-toggled #sidebar-wrapper { margin-left: 0; }
    body.sb-sidenav-toggled #page-content-wrapper {
        opacity: 0.5; pointer-events: none;
    }
}

/* =========================================
   4. CONTENT & HEADER
   ========================================= */

#page-content-wrapper .navbar {
    padding: 1rem 2rem;
    background: rgba(255,255,255,0.9) !important;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 900;
}

.btn-icon {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 4px 8px;
    color: var(--text-main);
    transition: all 0.2s;
    background: white;
}
.btn-icon:hover {
    background-color: var(--bg-body);
    border-color: #cbd5e1;
    transform: scale(1.05);
}

/* Badges */
.badge.bg-primary-soft {
    background-color: var(--primary-soft) !important;
    color: var(--primary) !important;
    font-weight: 600;
    border-radius: 6px;
    padding: 0.5em 0.8em;
}

/* Cards */
.card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    background: var(--bg-surface);
    margin-bottom: 1.5rem;
}

.card-header {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem 1.5rem;
    font-weight: 700;
    border-top-left-radius: var(--radius) !important;
    border-top-right-radius: var(--radius) !important;
}

/* =========================================
   5. KANBAN BOARD (Refined Colors)
   ========================================= */
.kanban-container {
    display: flex;
    overflow-x: auto;
    gap: 1.25rem;
    height: calc(100vh - 150px);
    padding-bottom: 20px;
}
.kanban-container::-webkit-scrollbar { height: 8px; }
.kanban-container::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

.kanban-column {
    flex: 0 0 300px;
    background: #f8fafc;
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
    max-height: 100%;
}

.kanban-header {
    padding: 14px;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    color: #fff;
    border-radius: var(--radius) var(--radius) 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Header Gradients */
.kanban-header.new                 { background: linear-gradient(135deg, #64748b 0%, #475569 100%); }
.kanban-header.no-answer           { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); }
.kanban-header.contacted-follow-up { background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%); }
.kanban-header.qualified           { background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%); }
.kanban-header.meetings-viewing    { background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%); }
.kanban-header.create-deal         { background: linear-gradient(135deg, #10b981 0%, #059669 100%); }
.kanban-header.closed-deal         { background: linear-gradient(135deg, #16a34a 0%, #15803d 100%); }
.kanban-header.lost-leads          { background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%); }
.kanban-header.spam                { background: linear-gradient(135deg, #374151 0%, #1f2937 100%); }

.kanban-header .badge {
    background: rgba(255,255,255,0.2) !important;
    color: #fff;
    backdrop-filter: blur(4px);
}

.kanban-items {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.kanban-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    margin-bottom: 12px;
    cursor: grab;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}
.kanban-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border-color: #cbd5e1;
}

/* Drag Skeleton */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
.sortable-ghost {
    background: #e2e8f0;
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite linear;
    border: none;
    opacity: 0.6;
    color: transparent;
}
.sortable-ghost * { visibility: hidden; }
.sortable-drag { opacity: 1; transform: rotate(3deg); cursor: grabbing; }

/* =========================================
   6. FORMS & BUTTONS
   ========================================= */
.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    padding: 0.7rem 1rem;
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

/* Button Gradients */
.btn-primary {
    background: var(--btn-gradient);
    border: none;
    border-radius: 8px;
    padding: 0.7rem 1.4rem;
    font-weight: 600;
    transition: all 0.2s;
}
.btn-primary:hover {
    box-shadow: 0 5px 15px rgba(79, 70, 229, 0.4);
    transform: translateY(-1px);
    filter: brightness(110%); /* Make gradient slightly brighter */
}

/* Table Headers */
.table thead th {
    background: #f8fafc;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    border-bottom: 1px solid var(--border-color);
}

/* =========================================
   9. PROFESSIONAL SPLIT AUTH SCREEN STYLING
   ========================================= */

/* Resetting the previous auth-body and wrapper */
.auth-body {
    background: var(--bg-body);
    min-height: 100vh;
    display: block; /* No longer need to center via flex on body */
}

.auth-split-wrapper {
    display: grid;
    /* On Desktop (md+), create two columns: 60% for image, 40% for form */
    grid-template-columns: 1fr; 
    min-height: 100vh;
}

@media (min-width: 992px) { /* Adjust breakpoint for a large split */
    .auth-split-wrapper {
        grid-template-columns: 3fr 2fr; /* Approx 60% left, 40% right */
    }
}

/* Left Side: Image/Branding */
.auth-split-left {
    background-color: #0f172a; /* Fallback color */
    
    /* CRITICAL: Set your background image here */
    background-image: url('https://leads.apartmentjvc.com/public/images/bg.webp');
    /* NOTE: Replace the image URL above with the path to YOUR actual image */
    
    background-size: cover;
    background-position: center;
    position: relative;
    padding: 4rem;
    display: flex;
    align-items: flex-end; /* Position content at the bottom */
}

/* Image Overlay (to make text readable) */
.auth-split-left::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0.1));
    z-index: 1;
}

.auth-image-content {
    z-index: 2;
    color: white;
}
.auth-image-content h1 {
    font-size: 2.5rem;
    color: white;
}
.auth-image-content p {
    font-size: 1.1rem;
    opacity: 0.9;
}
.auth-quote {
    margin-top: 2rem;
    font-style: italic;
    font-size: 0.9rem;
    border-left: 3px solid var(--primary);
    padding-left: 10px;
    color: #cbd5e1;
}

/* Right Side: Form Container */
.auth-split-right {
    background-color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
}

.auth-form-container {
    width: 100%;
    max-width: 400px; /* Constrain form size on large screens */
}

/* Form Card (from previous steps) */
.auth-card {
    background: #ffffff;
    padding: 2.5rem; /* Reduced padding as it's not a card, but a centered div */
    border-radius: var(--radius-lg);
    border: none;
    box-shadow: none;
    animation: none;
}
.auth-logo {
    margin-bottom: 2rem;
}
.auth-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-main);
}
.auth-subtitle {
    text-align: left;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    font-size: 1.1rem;
}

/* Final Note: You must remove the previous box-shadow from .auth-card
   if you're keeping it inside the final CSS block. */