@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    --crm-primary: #dc2626;
    --crm-primary-hover: #b91c1c;
    --crm-primary-light: #fee2e2;
    --crm-secondary: #f97316;
    --crm-secondary-hover: #ea580c;
    --crm-bg: #f8fafc;
    --crm-card-bg: #ffffff;
    --crm-text-dark: #1e293b;
    --crm-text-muted: #64748b;
    --crm-border: #e2e8f0;
    --crm-success: #16a34a;
    --crm-success-light: #dcfce7;
    --crm-danger: #dc2626;
    --crm-danger-light: #fee2e2;
    --crm-warning: #d97706;
    --crm-warning-light: #fef3c7;
    --crm-info: #0284c7;
    --crm-info-light: #e0f2fe;
    --crm-sidebar-width: 260px;
    --crm-border-radius: 0.75rem;
    --crm-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --crm-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --crm-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--crm-bg);
    color: var(--crm-text-dark);
    line-height: 1.6;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

#wrapper {
    display: flex;
    width: 100%;
    overflow-x: hidden;
}

/* Sidebar Styling */
#sidebar-wrapper {
    width: var(--crm-sidebar-width);
    background-color: #f9be0a !important;
    border-right: 1px solid rgba(0, 0, 0, 0.08);
    height: 100vh;
    transition: all 0.25s ease-out;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1030;
    overflow-y: auto;
}

.sidebar-heading {
    padding: 1.25rem 1.25rem 1rem;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--crm-primary);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f9be0a !important;
}

.sidebar-heading img {
    max-height: 90px;
    max-width: 90%;
    width: auto;
    object-fit: contain;
    transition: transform 0.2s ease;
}

.sidebar-heading img:hover {
    transform: scale(1.04);
}

.sidebar-category {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #613100;
    padding: 1.1rem 1.5rem 0.35rem;
}

.sidebar-menu .nav-link {
    color: #1e293b;
    padding: 0.7rem 1.5rem;
    font-weight: 600;
    font-size: 0.93rem;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    border-left: 4px solid transparent;
    transition: all 0.2s ease;
}

.sidebar-menu .nav-link:hover {
    color: #dc2626;
    background-color: rgba(255, 255, 255, 0.4);
}

.sidebar-menu .nav-link.active {
    color: #ffffff;
    background-color: #dc2626;
    border-left-color: #991b1b;
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(220, 38, 38, 0.35);
}

.sidebar-menu .nav-link i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

/* Content Area */
#page-content-wrapper {
    width: 100%;
    padding-left: var(--crm-sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: all 0.25s ease-out;
}

/* Desktop Toggled State */
#wrapper.toggled #sidebar-wrapper {
    margin-left: calc(-1 * var(--crm-sidebar-width));
}

#wrapper.toggled #page-content-wrapper {
    padding-left: 0;
}

/* Top Navbar */
.top-navbar {
    background-color: #ffffff;
    border-bottom: 1px solid var(--crm-border);
    padding: 0.85rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1020;
}

/* Cards & Widgets */
.crm-card {
    background-color: var(--crm-card-bg);
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-border-radius);
    box-shadow: var(--crm-shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.kpi-card {
    display: flex;
    align-items: center;
    padding: 1.25rem 1.5rem;
    gap: 1.25rem;
}

.kpi-icon {
    width: 54px;
    height: 54px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.kpi-icon.primary { background-color: var(--crm-primary-light); color: var(--crm-primary); }
.kpi-icon.secondary { background-color: #ffedd5; color: var(--crm-secondary); }
.kpi-icon.success { background-color: var(--crm-success-light); color: var(--crm-success); }
.kpi-icon.warning { background-color: var(--crm-warning-light); color: var(--crm-warning); }

.kpi-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--crm-text-dark);
    line-height: 1.2;
}

.kpi-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--crm-text-muted);
}

/* Buttons */
.btn-crm-primary {
    background-color: var(--crm-primary);
    color: #ffffff;
    border: none;
    font-weight: 600;
    border-radius: 0.5rem;
    padding: 0.6rem 1.25rem;
    transition: all 0.2s ease;
}

.btn-crm-primary:hover {
    background-color: var(--crm-primary-hover);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25);
}

.btn-crm-secondary {
    background-color: var(--crm-secondary);
    color: #ffffff;
    border: none;
    font-weight: 600;
    border-radius: 0.5rem;
    padding: 0.6rem 1.25rem;
}

.btn-crm-secondary:hover {
    background-color: var(--crm-secondary-hover);
    color: #ffffff;
}

/* Status Badges */
.badge-gap-pos {
    background-color: var(--crm-success-light);
    color: var(--crm-success);
    font-weight: 700;
    padding: 0.35rem 0.65rem;
    border-radius: 0.375rem;
}

.badge-gap-neg {
    background-color: var(--crm-danger-light);
    color: var(--crm-danger);
    font-weight: 700;
    padding: 0.35rem 0.65rem;
    border-radius: 0.375rem;
}

/* Questionnaire Wizard UI */
.wizard-progress {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
    position: relative;
}

.wizard-progress::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 3px;
    background-color: var(--crm-border);
    z-index: 1;
    transform: translateY(-50%);
}

.wizard-step {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #ffffff;
    border: 2px solid var(--crm-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--crm-text-muted);
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
}

.wizard-step.active {
    border-color: var(--crm-primary);
    background-color: var(--crm-primary);
    color: #ffffff;
}

.wizard-step.completed {
    border-color: var(--crm-success);
    background-color: var(--crm-success);
    color: #ffffff;
}

/* Mobile Bottom Navigation */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #ffffff;
    border-top: 1px solid var(--crm-border);
    display: flex;
    justify-content: space-around;
    padding: 0.5rem 0;
    z-index: 1040;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--crm-text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s ease;
}

.mobile-nav-item i {
    font-size: 1.25rem;
    margin-bottom: 0.15rem;
}

.mobile-nav-item.active {
    color: var(--crm-primary);
}

/* Recommendation Box */
.recommendation-box {
    background: linear-gradient(135deg, #fff5f5 0%, #ffe4e6 100%);
    border: 1px solid #fecdd3;
    border-left: 5px solid var(--crm-primary);
    border-radius: var(--crm-border-radius);
    padding: 1.25rem 1.5rem;
}

/* Sidebar Overlay for Mobile */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
}

@media (max-width: 991.98px) {
    #sidebar-wrapper {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: var(--crm-sidebar-width);
        z-index: 1050;
        transform: translateX(-100%);
        transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
        margin-left: 0 !important;
        box-shadow: none;
    }

    #sidebar-wrapper.show {
        transform: translateX(0);
        box-shadow: 4px 0 25px rgba(0, 0, 0, 0.25);
    }

    #page-content-wrapper {
        padding-left: 0 !important;
        margin-left: 0 !important;
        width: 100% !important;
    }

    body.mobile-padding {
        padding-bottom: 70px;
    }
}
