/* ═══════════════════════════════════════════════════════════════
   ehr_sidebar.css — Desktop sidebar navigation
   Load order: 2
   Visible: >768px only
   ═══════════════════════════════════════════════════════════════ */

.ehr-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--ehr-sidebar-width);
    background: var(--ehr-sidebar-bg);
    color: var(--ehr-sidebar-text);
    z-index: 1000;
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform var(--ehr-transition);
    transform: translateX(0);
}

/* Scrollbar styling */
.ehr-sidebar::-webkit-scrollbar {
    width: 4px;
}
.ehr-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 2px;
}

/* Hidden state */
.ehr-sidebar.collapsed {
    transform: translateX(calc(-1 * var(--ehr-sidebar-width)));
}

/* Logo area */
.ehr-sidebar-logo {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.ehr-sidebar-logo img {
    max-height: 40px;
    width: auto;
}

.ehr-sidebar-logo .ehr-logo-short {
    display: none;
    background: var(--ehr-green-accent);
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    padding: 6px 14px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

/* Nav items */
.ehr-sidebar-nav {
    padding: 8px 0;
}

.ehr-sidebar-item {
    position: relative;
}

.ehr-sidebar-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    color: var(--ehr-sidebar-text);
    font-size: 14px;
    font-weight: 500;
    transition: background var(--ehr-transition), color var(--ehr-transition);
    border-left: 3px solid transparent;
}

.ehr-sidebar-link:hover {
    background: var(--ehr-sidebar-hover);
    color: #fff;
}

.ehr-sidebar-link.active {
    background: var(--ehr-sidebar-active);
    color: #fff;
    border-left-color: var(--ehr-green-accent);
}

/* Dropdown arrow */
.ehr-sidebar-link .ehr-arrow {
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
    opacity: 0.5;
    flex-shrink: 0;
}

.ehr-sidebar-link .ehr-arrow svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.ehr-sidebar-item.open > .ehr-sidebar-link .ehr-arrow {
    transform: rotate(180deg);
    opacity: 0.8;
}

/* Submenu */
.ehr-sidebar-sub {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: rgba(0, 0, 0, 0.15);
}

.ehr-sidebar-item.open > .ehr-sidebar-sub {
    max-height: 500px;
}

.ehr-sidebar-sub a {
    display: block;
    padding: 9px 20px 9px 32px;
    color: var(--ehr-sidebar-text);
    font-size: 13px;
    transition: background var(--ehr-transition), color var(--ehr-transition);
}

.ehr-sidebar-sub a:hover {
    background: var(--ehr-sidebar-hover);
    color: #fff;
}

/* Hide sidebar on mobile */
@media (max-width: 768px) {
    .ehr-sidebar {
        display: none !important;
    }
}
