/*
 * Header + sidebar visuals. Layout/scroll stays in cbot-sidebar.css.
 * Palette matches Email Builder + header chips (slate, white, #796ae7).
 */

:root {
    --cbot-ink: #1e293b;
    --cbot-ink-soft: #64748b;
    --cbot-line: #e8edf3;
    --cbot-wash: #f4f6f9;
    --cbot-canvas: #f9fbfd;
    --cbot-hover: #eef2f7;
    --cbot-accent: #796ae7;
    --cbot-accent-soft: #f3f0ff;
    --cbot-accent-ink: #5b21b6;
    --cbot-page-pad: 30px;
}

/* Page views: top gap matches the existing left/right container padding. */
body main.main {
    padding-top: 18px !important;
}

/* White chrome + faint canvas so cards/tables keep a surface. */
body,
body.app,
body .app-body,
body main.main,
body .app-footer {
    background-color: var(--cbot-canvas) !important;
}

body .main .container-fluid {
    padding-left: var(--cbot-page-pad);
    padding-right: var(--cbot-page-pad);
}

/* ---------- Header ---------- */

body header.app-header.sticky-header,
body header.app-header.cbot-header {
    display: flex;
    align-items: center;
    background: #fff !important;
    border-bottom: 1px solid var(--cbot-line) !important;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.02);
    min-height: 58px;
    padding: 0 0.65rem 0 0.35rem;
}

body header.app-header .navbar-brand {
    margin-right: 0.75rem;
}

body header.app-header .navbar-toggler.cbot-notify-bell {
    box-sizing: border-box;
    flex: 0 0 35px;
    align-self: center;
    width: 35px !important;
    height: 35px !important;
    min-width: 35px;
    max-width: 35px;
    min-height: 35px;
    max-height: 35px;
    margin: 0 0.45rem 0 0.15rem;
    padding: 0 !important;
    border-radius: 50% !important;
    color: #4b5563;
    font-size: 1.05rem;
    line-height: 1;
}

body header.app-header .navbar-toggler.cbot-notify-bell i {
    color: inherit;
}

body header.app-header .navbar-nav.ml-auto {
    align-items: center;
    gap: 0.15rem;
}

body header.app-header .dropdown-menu {
    margin-top: 0.45rem;
    padding: 0.35rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.85rem;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
}

body header.app-header .dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.7rem;
    border-radius: 0.55rem;
    color: #334155;
    font-size: 0.86rem;
    font-weight: 500;
}

body header.app-header .dropdown-item i {
    color: #94a3b8;
    font-size: 0.95rem;
}

body header.app-header .dropdown-item:hover,
body header.app-header .dropdown-item:focus {
    background: var(--cbot-hover);
    color: var(--cbot-ink);
}

body header.app-header .dropdown-divider {
    margin: 0.3rem 0.35rem;
    border-top-color: var(--cbot-line);
}

body header.app-header .backpack-avatar-menu-container {
    background-color: var(--cbot-accent) !important;
    font-weight: 600 !important;
}

body header.app-header .nav-item.dropdown > .nav-link {
    width: 36px;
    height: 36px;
    margin: 0 0.35rem 0 0.15rem;
    padding: 0;
    border-radius: 50%;
}

@media (max-width: 991.98px) {
    body header.app-header.sticky-header,
    body header.app-header.cbot-header {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    body header.app-header .navbar-toggler.cbot-notify-bell {
        margin-left: 0.2rem;
        color: #4b5563;
    }

    body header.app-header .navbar-toggler.cbot-notify-bell:hover,
    body header.app-header .navbar-toggler.cbot-notify-bell:focus,
    body header.app-header .navbar-toggler.cbot-notify-bell:active {
        color: #111827;
    }

    body header.app-header .navbar-nav.ml-auto {
        margin-right: 0;
        padding-right: 0;
    }

    body header.app-header .nav-item.dropdown.pr-4 {
        min-width: 0;
        padding-right: 0.2rem !important;
    }

    body header.app-header .nav-item.dropdown > .nav-link {
        margin-right: 0 !important;
    }
}

/* ---------- Sidebar surface ---------- */

body .app-body > .sidebar.sidebar-pills {
    background-color: #f8fafc !important;
    color: var(--cbot-ink);
    border-right: 1px solid var(--cbot-line);
}

body .app-body > .sidebar .sidebar-nav {
    padding: 0.65rem 0.55rem 0.25rem;
}

body .app-body > .sidebar .nav {
    padding-left: 0;
    padding-right: 0;
}

/* ---------- Section labels ---------- */

body .sidebar .cbot-nav-label {
    list-style: none;
    margin: 0.85rem 0.45rem 0.35rem;
    padding: 0;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: #94a3b8;
    line-height: 1;
}

body .sidebar .cbot-nav-label:first-child {
    margin-top: 0.2rem;
}

/* ---------- Links ---------- */

body .sidebar.sidebar-pills .nav-link {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 2.15rem;
    margin: 0.08rem 0;
    padding: 0.42rem 0.65rem;
    border: 0;
    border-radius: 0.65rem;
    background: transparent !important;
    color: #334155 !important;
    font-size: 0.86rem;
    font-weight: 500;
    line-height: 1.25;
    box-shadow: none !important;
}

body .sidebar.sidebar-pills .nav-link .nav-icon {
    flex: 0 0 1.1rem;
    width: 1.1rem;
    margin: 0 !important;
    color: #94a3b8;
    font-size: 1.05rem;
    line-height: 1;
    text-align: center;
    vertical-align: middle;
}

body .sidebar.sidebar-pills .nav-link:hover,
body .sidebar.sidebar-pills .nav-link:focus {
    background: var(--cbot-hover) !important;
    color: var(--cbot-ink) !important;
    text-decoration: none;
}

body .sidebar.sidebar-pills .nav-link:hover .nav-icon,
body .sidebar.sidebar-pills .nav-link:focus .nav-icon {
    color: #64748b;
}

body .sidebar.sidebar-pills .nav-link.active {
    background: var(--cbot-accent-soft) !important;
    color: var(--cbot-accent-ink) !important;
    font-weight: 600;
}

body .sidebar.sidebar-pills .nav-link.active .nav-icon {
    color: var(--cbot-accent);
}

/* ---------- Dropdowns (CoreUI open class stays) ---------- */

body .sidebar.sidebar-pills .nav-dropdown-toggle {
    position: relative;
    padding-right: 1.7rem;
}

body .sidebar.sidebar-pills .nav-dropdown-toggle::before,
body .sidebar.sidebar-pills .nav-link:hover.nav-dropdown-toggle::before,
body .sidebar.sidebar-pills .nav-link:focus.nav-dropdown-toggle::before {
    right: 0.65rem;
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 11 14'%3E%3Cpath fill='%2394a3b8' d='M9.148 2.352l-4.148 4.148 4.148 4.148q0.148 0.148 0.148 0.352t-0.148 0.352l-1.297 1.297q-0.148 0.148-0.352 0.148t-0.352-0.148l-5.797-5.797q-0.148-0.148-0.148-0.352t0.148-0.352l5.797-5.797q0.148-0.148 0.352-0.148t0.352 0.148l1.297 1.297q0.148 0.148 0.148 0.352t-0.148 0.352z'/%3E%3C/svg%3E") !important;
}

body .sidebar.sidebar-pills .nav-dropdown.open {
    background: transparent !important;
}

body .sidebar.sidebar-pills .nav-dropdown.open > .nav-dropdown-toggle {
    color: var(--cbot-ink) !important;
}

body .sidebar.sidebar-pills .nav-dropdown-items {
    padding: 0.1rem 0 0.25rem 0.15rem;
    margin: 0 0 0.15rem 0.55rem;
    border-left: 1px solid #e2e8f0;
}

body .sidebar.sidebar-pills .nav-dropdown-items .nav-link {
    min-height: 1.95rem;
    padding: 0.32rem 0.55rem 0.32rem 0.7rem;
    font-size: 0.82rem;
    font-weight: 500;
}

body .sidebar.sidebar-pills .nav-dropdown-items .nav-dropdown-items {
    margin-left: 0.7rem;
}

body .sidebar.sidebar-pills .nav-dropdown-items .nav-icon {
    font-size: 0.95rem;
}

/* ---------- Badges ---------- */

body .sidebar .badge {
    float: none;
    margin-left: auto;
    margin-right: 0 !important;
    padding: 0.16rem 0.4rem;
    border-radius: 999px;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    line-height: 1.2;
}

body .sidebar .badge-warning {
    background: #fff7e6;
    color: #9a6700;
    border: 1px solid #f3e0b5;
}

/* ---------- Scrollbar ---------- */

body .app-body > .sidebar .sidebar-nav::-webkit-scrollbar {
    width: 8px;
}

body .app-body > .sidebar .sidebar-nav::-webkit-scrollbar-thumb {
    background: #d5dbe3;
    border-radius: 999px;
}

body .app-body > .sidebar .sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}
