/* ===== PURCHASE MANAGER SIDEBAR STYLES ===== */

/* Sidebar Container */
aside.pm-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: 280px;
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
    color: white;
    padding: 0;
    z-index: 999;
    box-shadow: 2px 0 15px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Custom Scrollbar */
aside.pm-sidebar::-webkit-scrollbar {
    width: 8px;
}

aside.pm-sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    margin-top: 80px;
    margin-bottom: 80px;
}

aside.pm-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.25);
    border-radius: 4px;
}

aside.pm-sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* Sidebar Header */
.pm-sidebar-header {
    padding: 25px 20px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    border-bottom: 2px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 0 0 auto;
    z-index: 20;
    position: relative;
    top: 0;
}

.pm-logo {
    font-size: 32px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.8) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    flex-shrink: 0;
}

.pm-logo-text {
    flex: 1;
    min-width: 0;
}

.pm-logo-title {
    font-size: 16px;
    font-weight: 700;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pm-logo-subtitle {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.75);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Sidebar Sections */
.pm-sidebar-section {
    padding: 20px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.pm-sidebar-section:last-child {
    border-bottom: none;
}

.pm-sidebar-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 1.2px;
    padding: 0 20px 12px 20px;
    display: block;
}

/* Navigation */
.pm-sidebar-nav {
    list-style: none;
    margin: 0;
    padding: 0;
}

.pm-sidebar-nav li {
    margin: 0;
}

.pm-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    margin: 0 10px;
    border-radius: 8px;
}

.pm-nav-link i {
    font-size: 16px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.pm-nav-link span {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pm-nav-link:hover {
    background: rgba(255, 255, 255, 0.12);
    color: white;
    padding-left: 24px;
}

.pm-nav-link.active {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-weight: 600;
    box-shadow: inset -3px 0 0 rgba(255, 255, 255, 0.4);
}

.pm-nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.3));
    border-radius: 0 3px 3px 0;
}

/* Badge */
.pm-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    background: #ef4444;
    color: white;
    border-radius: 11px;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
    margin-left: auto;
}

/* Account Section */
.pm-sidebar-account {
    /* Spacing handled by sidebar flexbox */
}

/* Sidebar Footer */
.pm-sidebar-footer {
    position: sticky;
    bottom: 0;
    padding: 15px 18px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.03) 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: auto;
    flex: 0 0 auto;
    z-index: 20;
    backdrop-filter: blur(10px);
}

.pm-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.pm-user-info {
    flex: 1;
    min-width: 0;
}

.pm-user-name {
    font-size: 13px;
    font-weight: 600;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pm-user-role {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Hamburger Button */
.pm-hamburger {
    display: none;
    position: fixed;
    top: 18px;
    left: 18px;
    z-index: 1000;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    flex-direction: column;
    gap: 5px;
}

.pm-hamburger span {
    display: block;
    width: 26px;
    height: 3px;
    background: #1e3a8a;
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.pm-hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(10px, 10px);
}

.pm-hamburger.active span:nth-child(2) {
    opacity: 0;
}

.pm-hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Sidebar Overlay */
.pm-sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Main Content Container */
.pm-main-container {
    margin-left: 280px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 100vh;
}

/* ===== RESPONSIVE DESIGN ===== */

/* Large Desktop (1441px and above) */
@media (min-width: 1441px) {
    aside.pm-sidebar {
        width: 300px;
    }

    .pm-main-container {
        margin-left: 300px;
    }
}

/* Desktop & Large Tablet (1025px to 1440px) */
@media (max-width: 1440px) and (min-width: 1025px) {
    aside.pm-sidebar {
        width: 280px;
    }

    .pm-main-container {
        margin-left: 280px;
    }
}

/* Tablet & Small Desktop (769px to 1024px) */
@media (max-width: 1024px) {
    aside.pm-sidebar {
        width: 90vw;
        max-width: 320px;
        transform: translateX(-100%);
    }

    aside.pm-sidebar.active {
        transform: translateX(0);
    }

    .pm-hamburger {
        display: flex;
    }

    .pm-sidebar-overlay {
        display: none;
    }

    .pm-sidebar-overlay.active {
        display: block;
    }

    .pm-main-container {
        margin-left: 0;
        padding-top: 70px;
    }
}

/* Mobile (481px to 768px) */
@media (max-width: 768px) {
    aside.pm-sidebar {
        width: 85vw;
        max-width: 300px;
        transform: translateX(-100%);
    }

    aside.pm-sidebar.active {
        transform: translateX(0);
    }

    .pm-hamburger {
        display: flex;
        top: 16px;
        left: 16px;
    }

    .pm-hamburger span {
        width: 24px;
        height: 2.5px;
    }

    .pm-sidebar-overlay.active {
        display: block;
    }

    .pm-main-container {
        margin-left: 0;
        padding-top: 65px;
    }

    .pm-logo-subtitle {
        display: none;
    }
}

/* Small Mobile (480px and below) */
@media (max-width: 480px) {
    aside.pm-sidebar {
        width: 80vw;
        transform: translateX(-100%);
    }

    aside.pm-sidebar.active {
        transform: translateX(0);
    }

    .pm-hamburger {
        display: flex;
        top: 14px;
        left: 14px;
    }

    .pm-hamburger span {
        width: 22px;
        height: 2px;
        margin: 3px 0;
    }

    .pm-sidebar-overlay.active {
        display: block;
    }

    .pm-nav-link {
        padding: 10px 14px;
        margin: 0 6px;
        font-size: 13px;
    }

    .pm-nav-link:hover {
        padding-left: 20px;
    }

    .pm-main-container {
        margin-left: 0;
        padding-top: 60px;
    }

    .pm-logo-subtitle {
        display: none;
    }

    .pm-sidebar-header {
        padding: 20px 16px;
    }
}

/* Extra Small Mobile (320px and below) */
@media (max-width: 320px) {
    aside.pm-sidebar {
        width: 75vw;
    }

    .pm-logo {
        font-size: 28px;
    }

    .pm-logo-title {
        font-size: 14px;
    }

    .pm-nav-link {
        padding: 8px 12px;
        font-size: 12px;
    }

    .pm-badge {
        min-width: 20px;
        height: 20px;
        font-size: 10px;
    }
}
