﻿/* =========================================
   1. DESIGN TOKENS
   ========================================= */
:root {
    /* Brand & Core Colors */
    --dash-bg: #e2e7e5;
    --dash-ink: #2d3436;
    --dash-ink-soft: #636e72;
    --dash-brand: #10b981;
    --dash-brand-dark: #0a9c6f;
    --dash-danger: #dc2626;
    /* Structural Radii & Shadows */
    --radius-lg: 18px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --shadow-sm: 0 2px 6px rgba(0, 0, 0, .03);
    --shadow-md: 0 8px 24px rgba(149, 157, 165, 0.12);
    --ease: cubic-bezier(.4, 0, .2, 1);
    /* Glassmorphism Configuration */
    --glass-bg: rgba(255, 255, 255, 0.55);
    --glass-border: rgba(255, 255, 255, 0.8);
    --glass-shadow: 0 8px 32px rgba(100, 110, 120, 0.12);
    --glass-blur: blur(20px);
    /* Layout Dimensions */
    --navbar-height: 70px;
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 70px;
}

/* =========================================
   2. GLOBAL RESET & BASE LAYOUT
   ========================================= */
* {
    box-sizing: border-box;
}

body, html {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    color: var(--dash-ink);
    background: radial-gradient(circle at 10% 15%, rgba(212, 178, 185, 0.8) 0%, transparent 45%), radial-gradient(circle at 85% 15%, rgba(184, 198, 191, 0.8) 0%, transparent 45%), radial-gradient(circle at 10% 85%, rgba(175, 193, 184, 0.8) 0%, transparent 50%), radial-gradient(circle at 85% 85%, rgba(218, 182, 190, 0.8) 0%, transparent 50%), radial-gradient(circle at 50% 50%, rgba(240, 243, 245, 0.95) 0%, transparent 60%), linear-gradient(135deg, #c8b2b7 0%, #b3c2bc 100%);
    background-attachment: fixed;
    background-size: cover;
}

.container-scroller {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 100vh;
}

.page-body-wrapper {
    display: flex;
    flex: 1;
    width: 100%;
    min-height: calc(100vh - var(--navbar-height));
    margin-top: var(--navbar-height);
    position: relative;
}

.main-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: calc(100% - var(--sidebar-width));
    margin-left: var(--sidebar-width);
    min-width: 0;
    overflow: hidden;
    transition: all 0.3s var(--ease);
}

.content-wrapper {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 25px;
    background: #f8f9fa;
    width: 100%;
}

/* =========================================
   3. GENERAL BUTTON UTILITIES & CARDS
   ========================================= */
.btn-gradient-badge {
    background: linear-gradient(135deg, #11998e 0%, #ff4b2b 100%);
    border: none;
    color: #ffffff !important;
    font-size: 0.9rem;
    padding: 0.55rem 1.4rem;
    border-radius: 50rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(17, 153, 142, 0.25);
    transition: all 0.3s var(--ease);
}

    .btn-gradient-badge:hover {
        background: linear-gradient(135deg, #0e8379 0%, #e03a1d 100%);
        box-shadow: 0 6px 18px rgba(255, 75, 43, 0.35);
        transform: translateY(-1px);
    }

.glass-card {
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: 20px;
    margin-bottom: 24px;
}

/* =========================================
   4. MODAL STYLING
   ========================================= */
#addLeadModal .modal-dialog,
#assignLeadModal .modal-dialog {
    max-width: 680px !important;
}

.custom-modal-header {
    background: linear-gradient(90deg, #3d6a36 0%, #a62a2a 100%) !important;
    color: #ffffff;
    border-radius: 12px 12px 0 0;
    padding: 14px 24px;
}

.custom-form-card {
    background: #ffffff;
    border-radius: 16px !important;
    border: none !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.form-section-title {
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: #2d3436;
    text-transform: uppercase;
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 6px;
    margin-bottom: 16px;
}

.form-custom-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: #495057;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 4px;
}

.form-custom-input {
    background-color: #f8f9fa !important;
    border: 1px solid #dee2e6 !important;
    border-radius: 8px !important;
    font-size: 0.88rem;
    color: #212529 !important;
    padding: 8px 12px !important;
}

    .form-custom-input:focus {
        background-color: #ffffff !important;
        border-color: #3d6a36 !important;
        box-shadow: 0 0 0 3px rgba(61, 106, 54, 0.15) !important;
    }

.btn-outline-danger-custom {
    color: #b71c1c;
    border: 1.5px solid #b71c1c;
    background: transparent;
    font-weight: 700;
    font-size: 0.85rem;
    border-radius: 8px;
    padding: 6px 24px;
    transition: all 0.2s ease;
}

    .btn-outline-danger-custom:hover {
        background-color: #b71c1c;
        color: #ffffff;
    }

.btn-cancel-custom {
    background-color: #eef2f5;
    color: #495057;
    border: 1px solid #ced4da;
    font-weight: 600;
    font-size: 0.85rem;
    border-radius: 8px;
    padding: 6px 24px;
}

.btn-save-custom {
    background-color: #2e7d32;
    color: #ffffff;
    border: none;
    font-weight: 700;
    font-size: 0.85rem;
    border-radius: 8px;
    padding: 6px 24px;
    transition: all 0.2s ease;
}

    .btn-save-custom:hover {
        background-color: #1b5e20;
    }

/* =========================================
   5. LAYOUT & SIDEBAR TOGGLE MECHANICS
   ========================================= */
/* Sidebar overlay for mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    width: 100%;
    height: calc(100vh - var(--navbar-height));
    background: rgba(0, 0, 0, 0.5);
    z-index: 1005;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

/* Desktop: Sidebar collapse/expand (icon rail) */
.sidebar {
    transition: width 0.3s ease, min-width 0.3s ease, margin-left 0.3s ease;
    z-index: 1010;
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
}

    .sidebar.sidebar-collapsed {
        width: var(--sidebar-collapsed-width) !important;
        min-width: var(--sidebar-collapsed-width) !important;
        overflow: hidden !important;
        padding: 0 !important;
    }

        .sidebar.sidebar-collapsed .menu-title,
        .sidebar.sidebar-collapsed .nav-category {
            display: none;
        }

        .sidebar.sidebar-collapsed .nav-link {
            justify-content: center;
            padding-left: 0;
            padding-right: 0;
        }

/* Main panel reacts to sidebar collapse */
#sidebar.sidebar-collapsed ~ .main-panel {
    width: calc(100% - var(--sidebar-collapsed-width));
    margin-left: var(--sidebar-collapsed-width);
}

/* =========================================
   6. RESPONSIVE MEDIA QUERIES
   ========================================= */
@media (max-width: 991px) {
    .main-panel {
        width: 100% !important;
        margin-left: 0 !important;
    }

    .sidebar {
        position: fixed !important;
        top: var(--navbar-height) !important;
        left: 0 !important;
        height: calc(100vh - var(--navbar-height)) !important;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1020 !important;
        width: var(--sidebar-width) !important;
        min-width: var(--sidebar-width) !important;
    }

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

        .sidebar.sidebar-collapsed {
            width: var(--sidebar-width) !important;
            min-width: var(--sidebar-width) !important;
            transform: translateX(-100%);
        }
}

@media (max-width: 768px) {
    .content-wrapper {
        padding: 16px;
    }

    .topbar {
        padding: 0 12px !important;
    }
}
