:root {
    /* Theme Colors - Change these to update the site's look */
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --sidebar-bg: #212529;
    --sidebar-text: #e9ecef;
    --sidebar-link-hover: #746a6a;
    --sidebar-link-hover-text: #e9ecef;
    --sidebar-active-bg: #0d6dfd65;
    --sidebar-active-text: #302f2f;
    --sidebar-heading-bg: rgba(0, 0, 0, 0.2);
    --sidebar-section-bg: #f8f9fa;
    --sidebar-section-text: #212529;
    --sidebar-section-border: #dee2e6;
    --sidebar-section-hover: rgba(0, 0, 0, 0.06);
    --sidebar-spacer-color: #929292;
    --header-bg: #ffffff;
    --footer-bg: #f8f9fa;
    --body-bg: #eefff6;
    --card-bg: #eefff6;
    --card-header-bg: #ffffff;
    --card-body-bg: #f3f3f3;
    --card-border: 1px solid rgba(0, 0, 0, 0.178);
    --page-holder-bg: #ffffff;
    --page-holder-header-bg: #f0f0f0;
    --page-holder-header-text: #0d6efd;
}

.card {
    background-color: var(--card-bg);
    border: var(--card-border) !important;
    overflow: hidden;
    /* Fix for rounded corners bleed */
}

.card-header {
    background-color: var(--card-header-bg);
}

.card-body {
    background-color: var(--card-body-bg);
}

/* Custom Page Holder Card */
.card.page-holder {
    background-color: var(--page-holder-bg) !important;
    overflow: hidden;
}

.card.page-holder>.card-header {
    background-color: var(--page-holder-header-bg) !important;
}

.card.page-holder>.card-header h5 {
    color: var(--page-holder-header-text) !important;
}

.card.page-holder>.card-body {
    background-color: var(--page-holder-bg) !important;
}

body {
    background-color: var(--body-bg);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Layout Structure */
#sidebar-wrapper {
    min-height: 100vh;
    height: 100vh;
    width: 15rem;
    overflow-y: auto;
    overflow-x: hidden;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    margin-left: -15rem;
    transition: all 0.25s ease-out;
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);

    /* Scrollbar Styling */
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

/* Webkit Scrollbar Styling (Chrome, Safari, Edge) */
#sidebar-wrapper::-webkit-scrollbar {
    width: 4px;
}

#sidebar-wrapper::-webkit-scrollbar-track {
    background: transparent;
}

#sidebar-wrapper::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

#sidebar-wrapper::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

#sidebar-wrapper .sidebar-heading {
    padding: 0.875rem 1.25rem;
    font-size: 1.2rem;
    color: var(--sidebar-text);
    background-color: var(--sidebar-heading-bg);
}

#sidebar-wrapper .list-group {
    width: 15rem;
}

#page-content-wrapper {
    min-width: 100vw;
}

body.sb-sidenav-toggled #wrapper #sidebar-wrapper {
    margin-left: 0;
}

@media (min-width: 768px) {
    #sidebar-wrapper {
        margin-left: 0;
    }

    #page-content-wrapper {
        padding-left: 15rem;
        min-width: 0;
        width: 100%;
        transition: padding 0.25s ease-out;
    }

    body.sb-sidenav-toggled #wrapper #sidebar-wrapper {
        margin-left: -15rem;
    }

    body.sb-sidenav-toggled #wrapper #page-content-wrapper {
        padding-left: 0;
    }
}

/* Sidebar Links */
#sidebar-wrapper .sidebar-link {
    color: var(--sidebar-text);
    text-decoration: none;
    padding: 0.75rem 1.25rem;
    display: block;
    transition: all 0.2s ease;
}

#sidebar-wrapper .sidebar-link:hover {
    background-color: var(--sidebar-link-hover) !important;
    color: var(--sidebar-link-hover-text) !important;
    text-decoration: none;
}

#sidebar-wrapper .sidebar-link.active {
    background-color: var(--sidebar-active-bg);
    color: var(--sidebar-active-text);
}

/* Navigation Spacer */
.nav-spacer {
    height: 1px;
    margin: 0.5rem 1rem;
    background-color: var(--sidebar-spacer-color);
    border: none;
}

/* Sidebar Section Headers */
#sidebar-wrapper .sidebar-section-header {
    color: var(--sidebar-text);
    text-decoration: none;
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
    cursor: pointer;
    font-weight: 500;
}

#sidebar-wrapper .sidebar-section-header:hover {
    background-color: var(--sidebar-link-hover) !important;
    color: var(--sidebar-link-hover-text) !important;
    text-decoration: none;
}

#sidebar-wrapper .sidebar-section-header[aria-expanded="true"] .bi-chevron-down {
    transform: rotate(180deg);
    transition: transform 0.3s ease;
    padding: 0.0rem 0.5rem;
}

#sidebar-wrapper .sidebar-section-header[aria-expanded="false"] .bi-chevron-down {
    transform: rotate(0deg);
    transition: transform 0.3s ease;
    padding: 0.0rem 0.5rem;
}

/* Sidebar Section Content */
.sidebar-section-content {
    background-color: var(--sidebar-section-bg);
}

/* Section links: whole area light background, dark text (override Bootstrap bg-dark/text-light) */
#sidebar-wrapper .sidebar-section-content .sidebar-link {
    background-color: var(--sidebar-section-bg) !important;
    color: var(--sidebar-section-text) !important;
    font-size: 0.9rem;
    padding: 0.6rem 1.25rem;
    border-left-color: transparent;
    border-color: var(--sidebar-section-border);
}

#sidebar-wrapper .sidebar-section-content .sidebar-link:hover {
    background-color: var(--sidebar-section-hover) !important;
    color: var(--sidebar-section-text) !important;
}

#sidebar-wrapper .sidebar-section-content .sidebar-link.active {
    background-color: var(--sidebar-active-bg) !important;
    color: var(--sidebar-active-text) !important;
    font-weight: 500;
}

/* Header & Footer */
.page-header {
    background-color: var(--page-holder-header-bg);
    padding: 1rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1030;
}

.page-footer {
    background-color: var(--footer-bg);
    padding: 1rem;
    margin-top: auto;
    border-top: 1px solid #dee2e6;
}

.main-content {
    padding: 2rem;
    flex: 1 0 auto;
}

/* Support Ticket Chat & Comments */
.chat-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.chat-bubble {
    max-width: 80%;
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    position: relative;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.chat-left {
    align-self: flex-start;
    background-color: #f0f7ff;
    border-bottom-left-radius: 0.25rem;
    border: 1px solid #b6d4fe;
}

.chat-right {
    align-self: flex-end;
    background-color: #f8f9fa;
    border-bottom-right-radius: 0.25rem;
    border: 1px solid #dee2e6;
}

.chat-header {
    font-size: 0.85rem;
    margin: -0.75rem -1rem 0.75rem -1rem;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    border-top-left-radius: 1rem;
    border-top-right-radius: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
}

.chat-left .chat-header {
    background-color: #cfe2ff;
    color: #084298;
}

.chat-right .chat-header {
    background-color: #e2e3e5;
    color: #41464b;
}

.chat-content {
    font-size: 0.95rem;
    color: #212529;
}

.chat-date {
    font-size: 0.75rem;
    opacity: 0.8;
}

optgroup {
    font-weight: normal !important;
    font-style: normal;
}

/* Glowing Border Effects */
.border-glow-primary {
    border: 2px solid var(--primary-color) !important;
    box-shadow: 0 0 15px rgba(13, 110, 253, 0.5);
    transition: box-shadow 0.3s ease-in-out;
}

/* Email Template Previewer Styles */
.preview-container {
    background: #f4f4f4;
    padding: 2rem;
    min-height: 600px;
    display: flex;
    justify-content: center;
}

.preview-frame {
    background: white;
    width: 100%;
    max-width: 800px;
    border: 1px solid var(--sidebar-section-border);
    overflow: auto;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}