﻿:root {
    --cp-sidebar-width: 270px;
}

/* =========================
   Sidebar
   ========================= */

.cp-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: var(--cp-sidebar-width);
    height: 100vh;
    z-index: 1000;
    background: rgba(255,255,255,.94);
    border-left: 1px solid rgba(0,0,0,.06);
    box-shadow: -8px 0 30px rgba(15,23,42,.06);
    display: flex;
    flex-direction: column;
    direction: rtl;
    transition: transform .25s ease, box-shadow .25s ease;
}

.dark .cp-sidebar {
    background: rgba(15,23,42,.96);
    border-left-color: rgba(255,255,255,.08);
}

/* Header */

.cp-sidebar-header {
    height: 76px;
    padding: 0 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(0,0,0,.06);
}

.dark .cp-sidebar-header {
    border-bottom-color: rgba(255,255,255,.08);
}

.cp-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

    .cp-sidebar-brand img {
        width: 38px;
        height: 38px;
        object-fit: contain;
    }

.cp-sidebar-brand-title {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
}

.dark .cp-sidebar-brand-title {
    color: #fff;
}

/* Garage */

.cp-sidebar-garage {
    margin: 14px 14px 8px;
    padding: 12px;
    border-radius: 14px;
    background: linear-gradient( 135deg, rgba(37,99,235,.10), rgba(59,130,246,.04) );
    border: 1px solid rgba(37,99,235,.10);
}

.cp-sidebar-garage-label {
    font-size: 11px;
    color: #64748b;
    margin-bottom: 4px;
}

.cp-sidebar-garage-name {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dark .cp-sidebar-garage-name {
    color: #fff;
}

.cp-sidebar-change-garage {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 8px;
    font-size: 11px;
    color: #2563eb;
    text-decoration: none;
}

/* Menu */

.cp-sidebar-menu {
    flex: 1;
    overflow-y: auto;
    padding: 8px 10px 20px;
}

.cp-sidebar-section-title {
    padding: 14px 10px 7px;
    font-size: 10px;
    font-weight: 700;
    color: #94a3b8;
}

.cp-sidebar-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 44px;
    padding: 9px 12px;
    margin: 3px 0;
    border-radius: 11px;
    color: #475569;
    text-decoration: none;
    transition: background .18s ease, color .18s ease, transform .18s ease;
}

    .cp-sidebar-link i {
        width: 22px;
        text-align: center;
        font-size: 15px;
    }

    .cp-sidebar-link:hover {
        background: rgba(37,99,235,.07);
        color: #2563eb;
    }

    .cp-sidebar-link.active {
        background: linear-gradient( 135deg, #164E63 0%, #124153 55%, #0E3442 100% ) !important;
        color: #fff;
        box-shadow: 0 6px 15px rgba(37,99,235,.20);
    }

        .cp-sidebar-link.active i {
            color: #fff;
        }

.dark .cp-sidebar-link {
    color: #cbd5e1;
}

    .dark .cp-sidebar-link:hover {
        background: rgba(59,130,246,.12);
        color: #60a5fa;
    }

/* User */

.cp-sidebar-user {
    padding: 12px;
    border-top: 1px solid rgba(0,0,0,.06);
}

.dark .cp-sidebar-user {
    border-top-color: rgba(255,255,255,.08);
}

.cp-sidebar-user-box {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px;
    border-radius: 12px;
    background: rgba(148,163,184,.08);
}

.cp-sidebar-user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
}

.cp-sidebar-user-info {
    min-width: 0;
    flex: 1;
}

.cp-sidebar-user-name {
    font-size: 13px;
    font-weight: 700;
    color: #334155;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dark .cp-sidebar-user-name {
    color: #fff;
}

.cp-sidebar-user-role {
    font-size: 10px;
    color: #94a3b8;
}

/* Content shift */

.cp-admin-content {
    margin-right: var(--cp-sidebar-width);
    width: calc(100% - var(--cp-sidebar-width));
    transition: margin-right .25s ease;
}

/* Mobile */

.cp-sidebar-toggle {
    display: none;
}

.cp-sidebar-overlay {
    display: none;
}

@media (max-width: 767px) {

    .cp-sidebar {
        transform: translateX(100%);
        box-shadow: none;
    }

        .cp-sidebar.open {
            transform: translateX(0);
            box-shadow: -10px 0 35px rgba(0,0,0,.18);
        }

    .cp-admin-content {
        margin-right: 0;
        width: 100%;
    }

    .cp-sidebar-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 42px;
        height: 42px;
        border: 0;
        border-radius: 10px;
        background: rgba(37,99,235,.10);
        color: #2563eb;
        cursor: pointer;
    }

    .cp-sidebar-overlay {
        position: fixed;
        inset: 0;
        z-index: 999;
        background: rgba(15,23,42,.45);
        backdrop-filter: blur(2px);
    }

        .cp-sidebar-overlay.open {
            display: block;
        }


}
