/* Entity detail sidebar — tags + notes panels */

#entityDetailSidebar {
    position: fixed;
    top: 0;
    right: -520px;
    width: 520px;
    max-width: 100vw;
    height: 100vh;
    background: #fff;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2000;
    display: flex;
    flex-direction: column;
}

#entityDetailSidebar.open {
    right: 0;
}

#entityDetailSidebar .entity-sidebar-header {
    padding: 1rem 1.25rem;
    background: #f2f2f2;
    border-bottom: 1px solid #d5d5d5;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

#entityDetailSidebar .entity-sidebar-header h5 {
    margin: 0;
    font-weight: 600;
    font-size: 1rem;
    line-height: 1.3;
    padding-right: 0.5rem;
}

#entityDetailSidebar .entity-sidebar-body {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

#entityDetailSidebar .entity-sidebar-nav {
    width: 52px;
    flex-shrink: 0;
    background: #fafafa;
    border-right: 1px solid #e8e8e8;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.75rem 0;
    gap: 0.25rem;
}

#entityDetailSidebar .entity-nav-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    border-radius: 8px;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

#entityDetailSidebar .entity-nav-btn:hover {
    background: #eee;
    color: #333;
}

#entityDetailSidebar .entity-nav-btn.active {
    background: rgba(240, 14, 75, 0.12);
    color: #f00e4b;
}

#entityDetailSidebar .entity-sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
}

#entityDetailSidebar .entity-panel {
    display: none;
}

#entityDetailSidebar .entity-panel.active {
    display: block;
}

#entityDetailSidebar .tags-field-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

#entityDetailSidebar .tags-input-wrap {
    border: 1px solid #dee2e6;
    border-radius: 6px;
    min-height: 120px;
    padding: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 0.35rem;
    cursor: text;
    background: #fff;
}

#entityDetailSidebar .tags-input-wrap:focus-within {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

#entityDetailSidebar .tag-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: #7c3aed;
    color: #fff;
    border-radius: 4px;
    padding: 0.2rem 0.5rem;
    font-size: 0.8125rem;
    line-height: 1.4;
}

#entityDetailSidebar .tag-pill-remove {
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.85);
    padding: 0;
    line-height: 1;
    cursor: pointer;
    font-size: 0.875rem;
}

#entityDetailSidebar .tag-pill-remove:hover {
    color: #fff;
}

#entityDetailSidebar .tags-text-input {
    border: none;
    outline: none;
    flex: 1 1 80px;
    min-width: 80px;
    font-size: 0.875rem;
    padding: 0.2rem;
}

#entityDetailSidebar .entity-save-btn {
    background: #22c55e;
    border: none;
    color: #fff;
    font-weight: 600;
    letter-spacing: 0.04em;
    padding: 0.5rem 1.25rem;
    border-radius: 4px;
    float: right;
    margin-top: 0.75rem;
}

#entityDetailSidebar .entity-save-btn:hover:not(:disabled) {
    background: #16a34a;
}

#entityDetailSidebar .entity-save-btn:disabled {
    opacity: 0.65;
}

.tag-filter-dropdown {
    position: relative;
    flex-shrink: 0;
}

.tag-filter-dropdown .dropdown-menu {
    min-width: 220px;
    max-height: 280px;
    overflow-y: auto;
    pointer-events: auto;
    z-index: 1060;
}

/* Parent .search-bar uses overflow-y:hidden; fixed popper keeps menu visible */
.search-bar .tag-filter-dropdown .dropdown-menu {
    position: fixed;
}

.tag-filter-dropdown [data-tag-filter-apply],
.tag-filter-dropdown [data-tag-filter-clear] {
    pointer-events: auto;
    cursor: pointer;
}

.tag-filter-dropdown .form-check {
    padding: 0.35rem 0.75rem 0.35rem 2rem;
}

.tag-filter-dropdown .form-check:hover {
    background: #f8f9fa;
}

.tag-filter-badge {
    font-size: 0.7rem;
    vertical-align: middle;
}
